imate
C++/CUDA Reference
_hutchinson_method.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.36 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "NPY_NO_DEPRECATED_API",
9  "NPY_1_7_API_VERSION"
10  ],
11  [
12  "CYTHON_EXTERN_C",
13  "extern \"C\""
14  ],
15  [
16  "NPY_NO_DEPRECATED_API",
17  "NPY_1_7_API_VERSION"
18  ],
19  [
20  "CYTHON_EXTERN_C",
21  "extern \"C\""
22  ],
23  [
24  "NPY_NO_DEPRECATED_API",
25  "NPY_1_7_API_VERSION"
26  ],
27  [
28  "CYTHON_EXTERN_C",
29  "extern \"C\""
30  ],
31  [
32  "NPY_NO_DEPRECATED_API",
33  "NPY_1_7_API_VERSION"
34  ],
35  [
36  "CYTHON_EXTERN_C",
37  "extern \"C\""
38  ],
39  [
40  "NPY_NO_DEPRECATED_API",
41  "NPY_1_7_API_VERSION"
42  ],
43  [
44  "CYTHON_EXTERN_C",
45  "extern \"C\""
46  ],
47  [
48  "NPY_NO_DEPRECATED_API",
49  "NPY_1_7_API_VERSION"
50  ],
51  [
52  "CYTHON_EXTERN_C",
53  "extern \"C\""
54  ],
55  [
56  "NPY_NO_DEPRECATED_API",
57  "NPY_1_7_API_VERSION"
58  ],
59  [
60  "CYTHON_EXTERN_C",
61  "extern \"C\""
62  ],
63  [
64  "NPY_NO_DEPRECATED_API",
65  "NPY_1_7_API_VERSION"
66  ],
67  [
68  "CYTHON_EXTERN_C",
69  "extern \"C\""
70  ],
71  [
72  "NPY_NO_DEPRECATED_API",
73  "NPY_1_7_API_VERSION"
74  ],
75  [
76  "CYTHON_EXTERN_C",
77  "extern \"C\""
78  ],
79  [
80  "NPY_NO_DEPRECATED_API",
81  "NPY_1_7_API_VERSION"
82  ],
83  [
84  "CYTHON_EXTERN_C",
85  "extern \"C\""
86  ],
87  [
88  "NPY_NO_DEPRECATED_API",
89  "NPY_1_7_API_VERSION"
90  ],
91  [
92  "CYTHON_EXTERN_C",
93  "extern \"C\""
94  ],
95  [
96  "NPY_NO_DEPRECATED_API",
97  "NPY_1_7_API_VERSION"
98  ],
99  [
100  "CYTHON_EXTERN_C",
101  "extern \"C\""
102  ],
103  [
104  "NPY_NO_DEPRECATED_API",
105  "NPY_1_7_API_VERSION"
106  ],
107  [
108  "CYTHON_EXTERN_C",
109  "extern \"C\""
110  ],
111  [
112  "NPY_NO_DEPRECATED_API",
113  "NPY_1_7_API_VERSION"
114  ],
115  [
116  "CYTHON_EXTERN_C",
117  "extern \"C\""
118  ],
119  [
120  "NPY_NO_DEPRECATED_API",
121  "NPY_1_7_API_VERSION"
122  ],
123  [
124  "CYTHON_EXTERN_C",
125  "extern \"C\""
126  ]
127  ],
128  "depends": [
129  "imate/_c_basic_algebra/c_vector_operations.cpp",
130  "imate/_c_basic_algebra/c_vector_operations.h"
131  ],
132  "include_dirs": [
133  "./imate/_c_basic_algebra",
134  "./imate/traceinv",
135  "i",
136  "m",
137  "a",
138  "t",
139  "e",
140  "/",
141  "f",
142  "u",
143  "n",
144  "c",
145  "o",
146  "s",
147  "_",
148  "b",
149  "l",
150  "g",
151  "r"
152  ],
153  "language": "c++",
154  "name": "imate.traceinv._hutchinson_method",
155  "sources": [
156  "./imate/traceinv/_hutchinson_method.pyx",
157  "imate/functions/inverse.cpp",
158  "imate/functions/functions.cpp",
159  "imate/functions/indicator.cpp",
160  "imate/functions/homographic.cpp",
161  "imate/functions/logarithm.cpp",
162  "imate/functions/gaussian.cpp",
163  "imate/functions/power.cpp",
164  "imate/functions/identity.cpp",
165  "imate/functions/exponential.cpp",
166  "imate/functions/smoothstep.cpp",
167  "imate/_c_basic_algebra/c_vector_operations.cpp",
168  "imate/_c_basic_algebra/cblas_interface.cpp",
169  "imate/_c_basic_algebra/c_matrix_operations.cpp"
170  ]
171  },
172  "module_name": "imate.traceinv._hutchinson_method"
173 }
174 END: Cython Metadata */
175 
176 #ifndef PY_SSIZE_T_CLEAN
177 #define PY_SSIZE_T_CLEAN
178 #endif /* PY_SSIZE_T_CLEAN */
179 #include "Python.h"
180 #ifndef Py_PYTHON_H
181  #error Python headers needed to compile C extensions, please install development version of Python.
182 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
183  #error Cython requires Python 2.6+ or Python 3.3+.
184 #else
185 #define CYTHON_ABI "0_29_36"
186 #define CYTHON_HEX_VERSION 0x001D24F0
187 #define CYTHON_FUTURE_DIVISION 1
188 #include <stddef.h>
189 #ifndef offsetof
190  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
191 #endif
192 #if !defined(WIN32) && !defined(MS_WINDOWS)
193  #ifndef __stdcall
194  #define __stdcall
195  #endif
196  #ifndef __cdecl
197  #define __cdecl
198  #endif
199  #ifndef __fastcall
200  #define __fastcall
201  #endif
202 #endif
203 #ifndef DL_IMPORT
204  #define DL_IMPORT(t) t
205 #endif
206 #ifndef DL_EXPORT
207  #define DL_EXPORT(t) t
208 #endif
209 #define __PYX_COMMA ,
210 #ifndef HAVE_LONG_LONG
211  #if PY_VERSION_HEX >= 0x02070000
212  #define HAVE_LONG_LONG
213  #endif
214 #endif
215 #ifndef PY_LONG_LONG
216  #define PY_LONG_LONG LONG_LONG
217 #endif
218 #ifndef Py_HUGE_VAL
219  #define Py_HUGE_VAL HUGE_VAL
220 #endif
221 #ifdef PYPY_VERSION
222  #define CYTHON_COMPILING_IN_PYPY 1
223  #define CYTHON_COMPILING_IN_PYSTON 0
224  #define CYTHON_COMPILING_IN_CPYTHON 0
225  #define CYTHON_COMPILING_IN_NOGIL 0
226  #undef CYTHON_USE_TYPE_SLOTS
227  #define CYTHON_USE_TYPE_SLOTS 0
228  #undef CYTHON_USE_PYTYPE_LOOKUP
229  #define CYTHON_USE_PYTYPE_LOOKUP 0
230  #if PY_VERSION_HEX < 0x03050000
231  #undef CYTHON_USE_ASYNC_SLOTS
232  #define CYTHON_USE_ASYNC_SLOTS 0
233  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
234  #define CYTHON_USE_ASYNC_SLOTS 1
235  #endif
236  #undef CYTHON_USE_PYLIST_INTERNALS
237  #define CYTHON_USE_PYLIST_INTERNALS 0
238  #undef CYTHON_USE_UNICODE_INTERNALS
239  #define CYTHON_USE_UNICODE_INTERNALS 0
240  #undef CYTHON_USE_UNICODE_WRITER
241  #define CYTHON_USE_UNICODE_WRITER 0
242  #undef CYTHON_USE_PYLONG_INTERNALS
243  #define CYTHON_USE_PYLONG_INTERNALS 0
244  #undef CYTHON_AVOID_BORROWED_REFS
245  #define CYTHON_AVOID_BORROWED_REFS 1
246  #undef CYTHON_ASSUME_SAFE_MACROS
247  #define CYTHON_ASSUME_SAFE_MACROS 0
248  #undef CYTHON_UNPACK_METHODS
249  #define CYTHON_UNPACK_METHODS 0
250  #undef CYTHON_FAST_THREAD_STATE
251  #define CYTHON_FAST_THREAD_STATE 0
252  #undef CYTHON_FAST_PYCALL
253  #define CYTHON_FAST_PYCALL 0
254  #if PY_VERSION_HEX < 0x03090000
255  #undef CYTHON_PEP489_MULTI_PHASE_INIT
256  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
257  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
258  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
259  #endif
260  #undef CYTHON_USE_TP_FINALIZE
261  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
262  #undef CYTHON_USE_DICT_VERSIONS
263  #define CYTHON_USE_DICT_VERSIONS 0
264  #undef CYTHON_USE_EXC_INFO_STACK
265  #define CYTHON_USE_EXC_INFO_STACK 0
266  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
267  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
268  #endif
269 #elif defined(PYSTON_VERSION)
270  #define CYTHON_COMPILING_IN_PYPY 0
271  #define CYTHON_COMPILING_IN_PYSTON 1
272  #define CYTHON_COMPILING_IN_CPYTHON 0
273  #define CYTHON_COMPILING_IN_NOGIL 0
274  #ifndef CYTHON_USE_TYPE_SLOTS
275  #define CYTHON_USE_TYPE_SLOTS 1
276  #endif
277  #undef CYTHON_USE_PYTYPE_LOOKUP
278  #define CYTHON_USE_PYTYPE_LOOKUP 0
279  #undef CYTHON_USE_ASYNC_SLOTS
280  #define CYTHON_USE_ASYNC_SLOTS 0
281  #undef CYTHON_USE_PYLIST_INTERNALS
282  #define CYTHON_USE_PYLIST_INTERNALS 0
283  #ifndef CYTHON_USE_UNICODE_INTERNALS
284  #define CYTHON_USE_UNICODE_INTERNALS 1
285  #endif
286  #undef CYTHON_USE_UNICODE_WRITER
287  #define CYTHON_USE_UNICODE_WRITER 0
288  #undef CYTHON_USE_PYLONG_INTERNALS
289  #define CYTHON_USE_PYLONG_INTERNALS 0
290  #ifndef CYTHON_AVOID_BORROWED_REFS
291  #define CYTHON_AVOID_BORROWED_REFS 0
292  #endif
293  #ifndef CYTHON_ASSUME_SAFE_MACROS
294  #define CYTHON_ASSUME_SAFE_MACROS 1
295  #endif
296  #ifndef CYTHON_UNPACK_METHODS
297  #define CYTHON_UNPACK_METHODS 1
298  #endif
299  #undef CYTHON_FAST_THREAD_STATE
300  #define CYTHON_FAST_THREAD_STATE 0
301  #undef CYTHON_FAST_PYCALL
302  #define CYTHON_FAST_PYCALL 0
303  #undef CYTHON_PEP489_MULTI_PHASE_INIT
304  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
305  #undef CYTHON_USE_TP_FINALIZE
306  #define CYTHON_USE_TP_FINALIZE 0
307  #undef CYTHON_USE_DICT_VERSIONS
308  #define CYTHON_USE_DICT_VERSIONS 0
309  #undef CYTHON_USE_EXC_INFO_STACK
310  #define CYTHON_USE_EXC_INFO_STACK 0
311  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
313  #endif
314 #elif defined(PY_NOGIL)
315  #define CYTHON_COMPILING_IN_PYPY 0
316  #define CYTHON_COMPILING_IN_PYSTON 0
317  #define CYTHON_COMPILING_IN_CPYTHON 0
318  #define CYTHON_COMPILING_IN_NOGIL 1
319  #ifndef CYTHON_USE_TYPE_SLOTS
320  #define CYTHON_USE_TYPE_SLOTS 1
321  #endif
322  #undef CYTHON_USE_PYTYPE_LOOKUP
323  #define CYTHON_USE_PYTYPE_LOOKUP 0
324  #ifndef CYTHON_USE_ASYNC_SLOTS
325  #define CYTHON_USE_ASYNC_SLOTS 1
326  #endif
327  #undef CYTHON_USE_PYLIST_INTERNALS
328  #define CYTHON_USE_PYLIST_INTERNALS 0
329  #ifndef CYTHON_USE_UNICODE_INTERNALS
330  #define CYTHON_USE_UNICODE_INTERNALS 1
331  #endif
332  #undef CYTHON_USE_UNICODE_WRITER
333  #define CYTHON_USE_UNICODE_WRITER 0
334  #undef CYTHON_USE_PYLONG_INTERNALS
335  #define CYTHON_USE_PYLONG_INTERNALS 0
336  #ifndef CYTHON_AVOID_BORROWED_REFS
337  #define CYTHON_AVOID_BORROWED_REFS 0
338  #endif
339  #ifndef CYTHON_ASSUME_SAFE_MACROS
340  #define CYTHON_ASSUME_SAFE_MACROS 1
341  #endif
342  #ifndef CYTHON_UNPACK_METHODS
343  #define CYTHON_UNPACK_METHODS 1
344  #endif
345  #undef CYTHON_FAST_THREAD_STATE
346  #define CYTHON_FAST_THREAD_STATE 0
347  #undef CYTHON_FAST_PYCALL
348  #define CYTHON_FAST_PYCALL 0
349  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
350  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
351  #endif
352  #ifndef CYTHON_USE_TP_FINALIZE
353  #define CYTHON_USE_TP_FINALIZE 1
354  #endif
355  #undef CYTHON_USE_DICT_VERSIONS
356  #define CYTHON_USE_DICT_VERSIONS 0
357  #undef CYTHON_USE_EXC_INFO_STACK
358  #define CYTHON_USE_EXC_INFO_STACK 0
359 #else
360  #define CYTHON_COMPILING_IN_PYPY 0
361  #define CYTHON_COMPILING_IN_PYSTON 0
362  #define CYTHON_COMPILING_IN_CPYTHON 1
363  #define CYTHON_COMPILING_IN_NOGIL 0
364  #ifndef CYTHON_USE_TYPE_SLOTS
365  #define CYTHON_USE_TYPE_SLOTS 1
366  #endif
367  #if PY_VERSION_HEX < 0x02070000
368  #undef CYTHON_USE_PYTYPE_LOOKUP
369  #define CYTHON_USE_PYTYPE_LOOKUP 0
370  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
371  #define CYTHON_USE_PYTYPE_LOOKUP 1
372  #endif
373  #if PY_MAJOR_VERSION < 3
374  #undef CYTHON_USE_ASYNC_SLOTS
375  #define CYTHON_USE_ASYNC_SLOTS 0
376  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
377  #define CYTHON_USE_ASYNC_SLOTS 1
378  #endif
379  #if PY_VERSION_HEX < 0x02070000
380  #undef CYTHON_USE_PYLONG_INTERNALS
381  #define CYTHON_USE_PYLONG_INTERNALS 0
382  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
383  #define CYTHON_USE_PYLONG_INTERNALS (PY_VERSION_HEX < 0x030C00A5)
384  #endif
385  #ifndef CYTHON_USE_PYLIST_INTERNALS
386  #define CYTHON_USE_PYLIST_INTERNALS 1
387  #endif
388  #ifndef CYTHON_USE_UNICODE_INTERNALS
389  #define CYTHON_USE_UNICODE_INTERNALS 1
390  #endif
391  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
392  #undef CYTHON_USE_UNICODE_WRITER
393  #define CYTHON_USE_UNICODE_WRITER 0
394  #elif !defined(CYTHON_USE_UNICODE_WRITER)
395  #define CYTHON_USE_UNICODE_WRITER 1
396  #endif
397  #ifndef CYTHON_AVOID_BORROWED_REFS
398  #define CYTHON_AVOID_BORROWED_REFS 0
399  #endif
400  #ifndef CYTHON_ASSUME_SAFE_MACROS
401  #define CYTHON_ASSUME_SAFE_MACROS 1
402  #endif
403  #ifndef CYTHON_UNPACK_METHODS
404  #define CYTHON_UNPACK_METHODS 1
405  #endif
406  #if PY_VERSION_HEX >= 0x030B00A4
407  #undef CYTHON_FAST_THREAD_STATE
408  #define CYTHON_FAST_THREAD_STATE 0
409  #elif !defined(CYTHON_FAST_THREAD_STATE)
410  #define CYTHON_FAST_THREAD_STATE 1
411  #endif
412  #ifndef CYTHON_FAST_PYCALL
413  #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
414  #endif
415  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
416  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
417  #endif
418  #ifndef CYTHON_USE_TP_FINALIZE
419  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
420  #endif
421  #ifndef CYTHON_USE_DICT_VERSIONS
422  #define CYTHON_USE_DICT_VERSIONS ((PY_VERSION_HEX >= 0x030600B1) && (PY_VERSION_HEX < 0x030C00A5))
423  #endif
424  #if PY_VERSION_HEX >= 0x030B00A4
425  #undef CYTHON_USE_EXC_INFO_STACK
426  #define CYTHON_USE_EXC_INFO_STACK 0
427  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
428  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
429  #endif
430  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
431  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
432  #endif
433 #endif
434 #if !defined(CYTHON_FAST_PYCCALL)
435 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
436 #endif
437 #if CYTHON_USE_PYLONG_INTERNALS
438  #if PY_MAJOR_VERSION < 3
439  #include "longintrepr.h"
440  #endif
441  #undef SHIFT
442  #undef BASE
443  #undef MASK
444  #ifdef SIZEOF_VOID_P
445  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
446  #endif
447 #endif
448 #ifndef __has_attribute
449  #define __has_attribute(x) 0
450 #endif
451 #ifndef __has_cpp_attribute
452  #define __has_cpp_attribute(x) 0
453 #endif
454 #ifndef CYTHON_RESTRICT
455  #if defined(__GNUC__)
456  #define CYTHON_RESTRICT __restrict__
457  #elif defined(_MSC_VER) && _MSC_VER >= 1400
458  #define CYTHON_RESTRICT __restrict
459  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
460  #define CYTHON_RESTRICT restrict
461  #else
462  #define CYTHON_RESTRICT
463  #endif
464 #endif
465 #ifndef CYTHON_UNUSED
466 # if defined(__GNUC__)
467 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
468 # define CYTHON_UNUSED __attribute__ ((__unused__))
469 # else
470 # define CYTHON_UNUSED
471 # endif
472 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
473 # define CYTHON_UNUSED __attribute__ ((__unused__))
474 # else
475 # define CYTHON_UNUSED
476 # endif
477 #endif
478 #ifndef CYTHON_MAYBE_UNUSED_VAR
479 # if defined(__cplusplus)
480  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
481 # else
482 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
483 # endif
484 #endif
485 #ifndef CYTHON_NCP_UNUSED
486 # if CYTHON_COMPILING_IN_CPYTHON
487 # define CYTHON_NCP_UNUSED
488 # else
489 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
490 # endif
491 #endif
492 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
493 #ifdef _MSC_VER
494  #ifndef _MSC_STDINT_H_
495  #if _MSC_VER < 1300
496  typedef unsigned char uint8_t;
497  typedef unsigned int uint32_t;
498  #else
499  typedef unsigned __int8 uint8_t;
500  typedef unsigned __int32 uint32_t;
501  #endif
502  #endif
503 #else
504  #include <stdint.h>
505 #endif
506 #ifndef CYTHON_FALLTHROUGH
507  #if defined(__cplusplus) && __cplusplus >= 201103L
508  #if __has_cpp_attribute(fallthrough)
509  #define CYTHON_FALLTHROUGH [[fallthrough]]
510  #elif __has_cpp_attribute(clang::fallthrough)
511  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
512  #elif __has_cpp_attribute(gnu::fallthrough)
513  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
514  #endif
515  #endif
516  #ifndef CYTHON_FALLTHROUGH
517  #if __has_attribute(fallthrough)
518  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
519  #else
520  #define CYTHON_FALLTHROUGH
521  #endif
522  #endif
523  #if defined(__clang__ ) && defined(__apple_build_version__)
524  #if __apple_build_version__ < 7000000
525  #undef CYTHON_FALLTHROUGH
526  #define CYTHON_FALLTHROUGH
527  #endif
528  #endif
529 #endif
530 
531 #ifndef __cplusplus
532  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
533 #endif
534 #ifndef CYTHON_INLINE
535  #if defined(__clang__)
536  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
537  #else
538  #define CYTHON_INLINE inline
539  #endif
540 #endif
541 template<typename T>
542 void __Pyx_call_destructor(T& x) {
543  x.~T();
544 }
545 template<typename T>
546 class __Pyx_FakeReference {
547  public:
548  __Pyx_FakeReference() : ptr(NULL) { }
549  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
550  T *operator->() { return ptr; }
551  T *operator&() { return ptr; }
552  operator T&() { return *ptr; }
553  template<typename U> bool operator ==(U other) { return *ptr == other; }
554  template<typename U> bool operator !=(U other) { return *ptr != other; }
555  private:
556  T *ptr;
557 };
558 
559 #define __PYX_BUILD_PY_SSIZE_T "n"
560 #define CYTHON_FORMAT_SSIZE_T "z"
561 #if PY_MAJOR_VERSION < 3
562  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
563  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
564  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
565  #define __Pyx_DefaultClassType PyClass_Type
566 #else
567  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
568  #define __Pyx_DefaultClassType PyType_Type
569 #if PY_VERSION_HEX >= 0x030B00A1
570  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
571  PyObject *code, PyObject *c, PyObject* n, PyObject *v,
572  PyObject *fv, PyObject *cell, PyObject* fn,
573  PyObject *name, int fline, PyObject *lnos) {
574  PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
575  PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
576  const char *fn_cstr=NULL;
577  const char *name_cstr=NULL;
578  PyCodeObject* co=NULL;
579  PyObject *type, *value, *traceback;
580  PyErr_Fetch(&type, &value, &traceback);
581  if (!(kwds=PyDict_New())) goto end;
582  if (!(argcount=PyLong_FromLong(a))) goto end;
583  if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
584  if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
585  if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
586  if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
587  if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
588  if (!(nlocals=PyLong_FromLong(l))) goto end;
589  if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
590  if (!(stacksize=PyLong_FromLong(s))) goto end;
591  if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
592  if (!(flags=PyLong_FromLong(f))) goto end;
593  if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
594  if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
595  if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
596  if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
597  if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
598  if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
599  if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
600  if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
601  if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
602  if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
603  if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
604  if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
605  if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
606  if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
607  Py_XDECREF((PyObject*)co);
608  co = (PyCodeObject*)call_result;
609  call_result = NULL;
610  if (0) {
611  cleanup_code_too:
612  Py_XDECREF((PyObject*)co);
613  co = NULL;
614  }
615  end:
616  Py_XDECREF(kwds);
617  Py_XDECREF(argcount);
618  Py_XDECREF(posonlyargcount);
619  Py_XDECREF(kwonlyargcount);
620  Py_XDECREF(nlocals);
621  Py_XDECREF(stacksize);
622  Py_XDECREF(replace);
623  Py_XDECREF(call_result);
624  Py_XDECREF(empty);
625  if (type) {
626  PyErr_Restore(type, value, traceback);
627  }
628  return co;
629  }
630 #else
631  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
632  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
633 #endif
634  #define __Pyx_DefaultClassType PyType_Type
635 #endif
636 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
637  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
638 #else
639  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
640 #endif
641 #ifndef Py_TPFLAGS_CHECKTYPES
642  #define Py_TPFLAGS_CHECKTYPES 0
643 #endif
644 #ifndef Py_TPFLAGS_HAVE_INDEX
645  #define Py_TPFLAGS_HAVE_INDEX 0
646 #endif
647 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
648  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
649 #endif
650 #ifndef Py_TPFLAGS_HAVE_FINALIZE
651  #define Py_TPFLAGS_HAVE_FINALIZE 0
652 #endif
653 #ifndef METH_STACKLESS
654  #define METH_STACKLESS 0
655 #endif
656 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
657  #ifndef METH_FASTCALL
658  #define METH_FASTCALL 0x80
659  #endif
660  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
661  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
662  Py_ssize_t nargs, PyObject *kwnames);
663 #else
664  #define __Pyx_PyCFunctionFast _PyCFunctionFast
665  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
666 #endif
667 #if CYTHON_FAST_PYCCALL
668 #define __Pyx_PyFastCFunction_Check(func)\
669  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
670 #else
671 #define __Pyx_PyFastCFunction_Check(func) 0
672 #endif
673 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
674  #define PyObject_Malloc(s) PyMem_Malloc(s)
675  #define PyObject_Free(p) PyMem_Free(p)
676  #define PyObject_Realloc(p) PyMem_Realloc(p)
677 #endif
678 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
679  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
680  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
681  #define PyMem_RawFree(p) PyMem_Free(p)
682 #endif
683 #if CYTHON_COMPILING_IN_PYSTON
684  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
685  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
686 #else
687  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
688  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
689 #endif
690 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
691  #define __Pyx_PyThreadState_Current PyThreadState_GET()
692 #elif PY_VERSION_HEX >= 0x03060000
693  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
694 #elif PY_VERSION_HEX >= 0x03000000
695  #define __Pyx_PyThreadState_Current PyThreadState_GET()
696 #else
697  #define __Pyx_PyThreadState_Current _PyThreadState_Current
698 #endif
699 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
700 #include "pythread.h"
701 #define Py_tss_NEEDS_INIT 0
702 typedef int Py_tss_t;
703 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
704  *key = PyThread_create_key();
705  return 0;
706 }
707 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
708  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
709  *key = Py_tss_NEEDS_INIT;
710  return key;
711 }
712 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
713  PyObject_Free(key);
714 }
715 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
716  return *key != Py_tss_NEEDS_INIT;
717 }
718 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
719  PyThread_delete_key(*key);
720  *key = Py_tss_NEEDS_INIT;
721 }
722 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
723  return PyThread_set_key_value(*key, value);
724 }
725 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
726  return PyThread_get_key_value(*key);
727 }
728 #endif
729 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
730 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
731 #else
732 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
733 #endif
734 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
735  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
736  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
737 #else
738  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
739  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
740 #endif
741 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
742 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
743 #else
744 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
745 #endif
746 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
747  #define CYTHON_PEP393_ENABLED 1
748  #if PY_VERSION_HEX >= 0x030C0000
749  #define __Pyx_PyUnicode_READY(op) (0)
750  #else
751  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
752  0 : _PyUnicode_Ready((PyObject *)(op)))
753  #endif
754  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
755  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
756  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
757  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
758  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
759  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
760  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
761  #if PY_VERSION_HEX >= 0x030C0000
762  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
763  #else
764  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
765  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
766  #else
767  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
768  #endif
769  #endif
770 #else
771  #define CYTHON_PEP393_ENABLED 0
772  #define PyUnicode_1BYTE_KIND 1
773  #define PyUnicode_2BYTE_KIND 2
774  #define PyUnicode_4BYTE_KIND 4
775  #define __Pyx_PyUnicode_READY(op) (0)
776  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
777  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
778  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
779  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
780  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
781  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
782  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
783  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
784 #endif
785 #if CYTHON_COMPILING_IN_PYPY
786  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
787  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
788 #else
789  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
790  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
791  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
792 #endif
793 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
794  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
795 #endif
796 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
797  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
798 #endif
799 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
800  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
801 #endif
802 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
803 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
804 #if PY_MAJOR_VERSION >= 3
805  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
806 #else
807  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
808 #endif
809 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
810  #define PyObject_ASCII(o) PyObject_Repr(o)
811 #endif
812 #if PY_MAJOR_VERSION >= 3
813  #define PyBaseString_Type PyUnicode_Type
814  #define PyStringObject PyUnicodeObject
815  #define PyString_Type PyUnicode_Type
816  #define PyString_Check PyUnicode_Check
817  #define PyString_CheckExact PyUnicode_CheckExact
818 #ifndef PyObject_Unicode
819  #define PyObject_Unicode PyObject_Str
820 #endif
821 #endif
822 #if PY_MAJOR_VERSION >= 3
823  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
824  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
825 #else
826  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
827  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
828 #endif
829 #ifndef PySet_CheckExact
830  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
831 #endif
832 #if PY_VERSION_HEX >= 0x030900A4
833  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
834  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
835 #else
836  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
837  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
838 #endif
839 #if CYTHON_ASSUME_SAFE_MACROS
840  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
841 #else
842  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
843 #endif
844 #if PY_MAJOR_VERSION >= 3
845  #define PyIntObject PyLongObject
846  #define PyInt_Type PyLong_Type
847  #define PyInt_Check(op) PyLong_Check(op)
848  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
849  #define PyInt_FromString PyLong_FromString
850  #define PyInt_FromUnicode PyLong_FromUnicode
851  #define PyInt_FromLong PyLong_FromLong
852  #define PyInt_FromSize_t PyLong_FromSize_t
853  #define PyInt_FromSsize_t PyLong_FromSsize_t
854  #define PyInt_AsLong PyLong_AsLong
855  #define PyInt_AS_LONG PyLong_AS_LONG
856  #define PyInt_AsSsize_t PyLong_AsSsize_t
857  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
858  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
859  #define PyNumber_Int PyNumber_Long
860 #endif
861 #if PY_MAJOR_VERSION >= 3
862  #define PyBoolObject PyLongObject
863 #endif
864 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
865  #ifndef PyUnicode_InternFromString
866  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
867  #endif
868 #endif
869 #if PY_VERSION_HEX < 0x030200A4
870  typedef long Py_hash_t;
871  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
872  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
873 #else
874  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
875  #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
876 #endif
877 #if PY_MAJOR_VERSION >= 3
878  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
879 #else
880  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
881 #endif
882 #if CYTHON_USE_ASYNC_SLOTS
883  #if PY_VERSION_HEX >= 0x030500B1
884  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
885  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
886  #else
887  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
888  #endif
889 #else
890  #define __Pyx_PyType_AsAsync(obj) NULL
891 #endif
892 #ifndef __Pyx_PyAsyncMethodsStruct
893  typedef struct {
894  unaryfunc am_await;
895  unaryfunc am_aiter;
896  unaryfunc am_anext;
897  } __Pyx_PyAsyncMethodsStruct;
898 #endif
899 
900 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
901  #if !defined(_USE_MATH_DEFINES)
902  #define _USE_MATH_DEFINES
903  #endif
904 #endif
905 #include <math.h>
906 #ifdef NAN
907 #define __PYX_NAN() ((float) NAN)
908 #else
909 static CYTHON_INLINE float __PYX_NAN() {
910  float value;
911  memset(&value, 0xFF, sizeof(value));
912  return value;
913 }
914 #endif
915 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
916 #define __Pyx_truncl trunc
917 #else
918 #define __Pyx_truncl truncl
919 #endif
920 
921 #define __PYX_MARK_ERR_POS(f_index, lineno) \
922  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
923 #define __PYX_ERR(f_index, lineno, Ln_error) \
924  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
925 
926 #ifndef __PYX_EXTERN_C
927  #ifdef __cplusplus
928  #define __PYX_EXTERN_C extern "C"
929  #else
930  #define __PYX_EXTERN_C extern
931  #endif
932 #endif
933 
934 #define __PYX_HAVE__imate__traceinv___hutchinson_method
935 #define __PYX_HAVE_API__imate__traceinv___hutchinson_method
936 /* Early includes */
937 #include "c_vector_operations.cpp"
938 #include "c_vector_operations.h"
939 #include "pythread.h"
940 #include <string.h>
941 #include <stdlib.h>
942 #include <stdio.h>
943 #include "pystate.h"
944 #ifdef _OPENMP
945 #include <omp.h>
946 #endif /* _OPENMP */
947 
948 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
949 #define CYTHON_WITHOUT_ASSERTIONS
950 #endif
951 
952 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
953  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
954 
955 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
956 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
957 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
958 #define __PYX_DEFAULT_STRING_ENCODING ""
959 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
960 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
961 #define __Pyx_uchar_cast(c) ((unsigned char)c)
962 #define __Pyx_long_cast(x) ((long)x)
963 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
964  (sizeof(type) < sizeof(Py_ssize_t)) ||\
965  (sizeof(type) > sizeof(Py_ssize_t) &&\
966  likely(v < (type)PY_SSIZE_T_MAX ||\
967  v == (type)PY_SSIZE_T_MAX) &&\
968  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
969  v == (type)PY_SSIZE_T_MIN))) ||\
970  (sizeof(type) == sizeof(Py_ssize_t) &&\
971  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
972  v == (type)PY_SSIZE_T_MAX))) )
973 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
974  return (size_t) i < (size_t) limit;
975 }
976 #if defined (__cplusplus) && __cplusplus >= 201103L
977  #include <cstdlib>
978  #define __Pyx_sst_abs(value) std::abs(value)
979 #elif SIZEOF_INT >= SIZEOF_SIZE_T
980  #define __Pyx_sst_abs(value) abs(value)
981 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
982  #define __Pyx_sst_abs(value) labs(value)
983 #elif defined (_MSC_VER)
984  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
985 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
986  #define __Pyx_sst_abs(value) llabs(value)
987 #elif defined (__GNUC__)
988  #define __Pyx_sst_abs(value) __builtin_llabs(value)
989 #else
990  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
991 #endif
992 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
993 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
994 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
995 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
996 #define __Pyx_PyBytes_FromString PyBytes_FromString
997 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
998 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
999 #if PY_MAJOR_VERSION < 3
1000  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1001  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1002 #else
1003  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1004  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1005 #endif
1006 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1007 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1008 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1009 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1010 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1011 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1012 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
1013 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
1014 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
1015 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1016 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1017 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1018 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1019 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1020 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1021 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1022 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
1023  const Py_UNICODE *u_end = u;
1024  while (*u_end++) ;
1025  return (size_t)(u_end - u - 1);
1026 }
1027 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1028 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1029 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1030 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1031 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1032 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1033 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1034 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1035 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1036 #define __Pyx_PySequence_Tuple(obj)\
1037  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1038 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1039 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1040 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1041 #if CYTHON_ASSUME_SAFE_MACROS
1042 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1043 #else
1044 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1045 #endif
1046 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1047 #if PY_MAJOR_VERSION >= 3
1048 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1049 #else
1050 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1051 #endif
1052 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
1053 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1054 static int __Pyx_sys_getdefaultencoding_not_ascii;
1055 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1056  PyObject* sys;
1057  PyObject* default_encoding = NULL;
1058  PyObject* ascii_chars_u = NULL;
1059  PyObject* ascii_chars_b = NULL;
1060  const char* default_encoding_c;
1061  sys = PyImport_ImportModule("sys");
1062  if (!sys) goto bad;
1063  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1064  Py_DECREF(sys);
1065  if (!default_encoding) goto bad;
1066  default_encoding_c = PyBytes_AsString(default_encoding);
1067  if (!default_encoding_c) goto bad;
1068  if (strcmp(default_encoding_c, "ascii") == 0) {
1069  __Pyx_sys_getdefaultencoding_not_ascii = 0;
1070  } else {
1071  char ascii_chars[128];
1072  int c;
1073  for (c = 0; c < 128; c++) {
1074  ascii_chars[c] = c;
1075  }
1076  __Pyx_sys_getdefaultencoding_not_ascii = 1;
1077  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1078  if (!ascii_chars_u) goto bad;
1079  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1080  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1081  PyErr_Format(
1082  PyExc_ValueError,
1083  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1084  default_encoding_c);
1085  goto bad;
1086  }
1087  Py_DECREF(ascii_chars_u);
1088  Py_DECREF(ascii_chars_b);
1089  }
1090  Py_DECREF(default_encoding);
1091  return 0;
1092 bad:
1093  Py_XDECREF(default_encoding);
1094  Py_XDECREF(ascii_chars_u);
1095  Py_XDECREF(ascii_chars_b);
1096  return -1;
1097 }
1098 #endif
1099 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1100 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1101 #else
1102 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1103 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1104 static char* __PYX_DEFAULT_STRING_ENCODING;
1105 static int __Pyx_init_sys_getdefaultencoding_params(void) {
1106  PyObject* sys;
1107  PyObject* default_encoding = NULL;
1108  char* default_encoding_c;
1109  sys = PyImport_ImportModule("sys");
1110  if (!sys) goto bad;
1111  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1112  Py_DECREF(sys);
1113  if (!default_encoding) goto bad;
1114  default_encoding_c = PyBytes_AsString(default_encoding);
1115  if (!default_encoding_c) goto bad;
1116  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1117  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1118  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1119  Py_DECREF(default_encoding);
1120  return 0;
1121 bad:
1122  Py_XDECREF(default_encoding);
1123  return -1;
1124 }
1125 #endif
1126 #endif
1127 
1128 
1129 /* Test for GCC > 2.95 */
1130 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1131  #define likely(x) __builtin_expect(!!(x), 1)
1132  #define unlikely(x) __builtin_expect(!!(x), 0)
1133 #else /* !__GNUC__ or GCC < 2.95 */
1134  #define likely(x) (x)
1135  #define unlikely(x) (x)
1136 #endif /* __GNUC__ */
1137 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1138 
1139 static PyObject *__pyx_m = NULL;
1140 static PyObject *__pyx_d;
1141 static PyObject *__pyx_b;
1142 static PyObject *__pyx_cython_runtime = NULL;
1143 static PyObject *__pyx_empty_tuple;
1144 static PyObject *__pyx_empty_bytes;
1145 static PyObject *__pyx_empty_unicode;
1146 static int __pyx_lineno;
1147 static int __pyx_clineno = 0;
1148 static const char * __pyx_cfilenm= __FILE__;
1149 static const char *__pyx_filename;
1150 
1151 
1152 static const char *__pyx_f[] = {
1153  "imate/traceinv/_hutchinson_method.pyx",
1154  "stringsource",
1155 };
1156 /* MemviewSliceStruct.proto */
1157 struct __pyx_memoryview_obj;
1158 typedef struct {
1159  struct __pyx_memoryview_obj *memview;
1160  char *data;
1161  Py_ssize_t shape[8];
1162  Py_ssize_t strides[8];
1163  Py_ssize_t suboffsets[8];
1164 } __Pyx_memviewslice;
1165 #define __Pyx_MemoryView_Len(m) (m.shape[0])
1166 
1167 /* Atomics.proto */
1168 #include <pythread.h>
1169 #ifndef CYTHON_ATOMICS
1170  #define CYTHON_ATOMICS 1
1171 #endif
1172 #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1173 #define __pyx_atomic_int_type int
1174 #if CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1175  (__GNUC_MINOR__ > 1 ||\
1176  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1177  #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1178  #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1179  #ifdef __PYX_DEBUG_ATOMICS
1180  #warning "Using GNU atomics"
1181  #endif
1182 #elif CYTHON_ATOMICS && defined(_MSC_VER) && CYTHON_COMPILING_IN_NOGIL
1183  #include <intrin.h>
1184  #undef __pyx_atomic_int_type
1185  #define __pyx_atomic_int_type long
1186  #pragma intrinsic (_InterlockedExchangeAdd)
1187  #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1188  #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1189  #ifdef __PYX_DEBUG_ATOMICS
1190  #pragma message ("Using MSVC atomics")
1191  #endif
1192 #else
1193  #undef CYTHON_ATOMICS
1194  #define CYTHON_ATOMICS 0
1195  #ifdef __PYX_DEBUG_ATOMICS
1196  #warning "Not using atomics"
1197  #endif
1198 #endif
1199 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
1200 #if CYTHON_ATOMICS
1201  #define __pyx_add_acquisition_count(memview)\
1202  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1203  #define __pyx_sub_acquisition_count(memview)\
1204  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1205 #else
1206  #define __pyx_add_acquisition_count(memview)\
1207  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1208  #define __pyx_sub_acquisition_count(memview)\
1209  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1210 #endif
1211 
1212 /* ForceInitThreads.proto */
1213 #ifndef __PYX_FORCE_INIT_THREADS
1214  #define __PYX_FORCE_INIT_THREADS 0
1215 #endif
1216 
1217 /* NoFastGil.proto */
1218 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1219 #define __Pyx_PyGILState_Release PyGILState_Release
1220 #define __Pyx_FastGIL_Remember()
1221 #define __Pyx_FastGIL_Forget()
1222 #define __Pyx_FastGilFuncInit()
1223 
1224 /* BufferFormatStructs.proto */
1225 #define IS_UNSIGNED(type) (((type) -1) > 0)
1226 struct __Pyx_StructField_;
1227 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1228 typedef struct {
1229  const char* name;
1230  struct __Pyx_StructField_* fields;
1231  size_t size;
1232  size_t arraysize[8];
1233  int ndim;
1234  char typegroup;
1235  char is_unsigned;
1236  int flags;
1237 } __Pyx_TypeInfo;
1238 typedef struct __Pyx_StructField_ {
1239  __Pyx_TypeInfo* type;
1240  const char* name;
1241  size_t offset;
1242 } __Pyx_StructField;
1243 typedef struct {
1244  __Pyx_StructField* field;
1245  size_t parent_offset;
1246 } __Pyx_BufFmt_StackElem;
1247 typedef struct {
1248  __Pyx_StructField root;
1249  __Pyx_BufFmt_StackElem* head;
1250  size_t fmt_offset;
1251  size_t new_count, enc_count;
1252  size_t struct_alignment;
1253  int is_complex;
1254  char enc_type;
1255  char new_packmode;
1256  char enc_packmode;
1257  char is_valid_array;
1258 } __Pyx_BufFmt_Context;
1259 
1260 
1261 /* "_definitions/types.pxd":97
1262  * ctypedef unsigned int[:] MemoryViewLongIndexType
1263  * ELSE:
1264  * ctypedef int LongIndexType # <<<<<<<<<<<<<<
1265  * ctypedef const int ConstLongIndexType
1266  * ctypedef int[:] MemoryViewLongIndexType
1267  */
1268 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1269 
1270 /* "_definitions/types.pxd":98
1271  * ELSE:
1272  * ctypedef int LongIndexType
1273  * ctypedef const int ConstLongIndexType # <<<<<<<<<<<<<<
1274  * ctypedef int[:] MemoryViewLongIndexType
1275  *
1276  */
1277 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1278 
1279 /* "_definitions/types.pxd":102
1280  *
1281  * # Used for indices of small matrices, or small size iterators
1282  * ctypedef int IndexType # <<<<<<<<<<<<<<
1283  * ctypedef const int ConstIndexType
1284  * ctypedef int[:] MemoryViewIndexType
1285  */
1286 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1287 
1288 /* "_definitions/types.pxd":103
1289  * # Used for indices of small matrices, or small size iterators
1290  * ctypedef int IndexType
1291  * ctypedef const int ConstIndexType # <<<<<<<<<<<<<<
1292  * ctypedef int[:] MemoryViewIndexType
1293  *
1294  */
1295 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1296 
1297 /* "_definitions/types.pxd":107
1298  *
1299  * # Used for both flags and integers used as signals, including negative integers
1300  * ctypedef int FlagType # <<<<<<<<<<<<<<
1301  * ctypedef const int ConstFlagType
1302  * ctypedef int[:] MemoryViewFlagType
1303  */
1304 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1305 
1306 /* "_definitions/types.pxd":108
1307  * # Used for both flags and integers used as signals, including negative integers
1308  * ctypedef int FlagType
1309  * ctypedef const int ConstFlagType # <<<<<<<<<<<<<<
1310  * ctypedef int[:] MemoryViewFlagType
1311  *
1312  */
1313 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1314 
1315 /*--- Type declarations ---*/
1316 struct __pyx_array_obj;
1317 struct __pyx_MemviewEnum_obj;
1318 struct __pyx_memoryview_obj;
1319 struct __pyx_memoryviewslice_obj;
1320 
1321 /* "_definitions/types.pxd":99
1322  * ctypedef int LongIndexType
1323  * ctypedef const int ConstLongIndexType
1324  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1325  *
1326  * # Used for indices of small matrices, or small size iterators
1327  */
1328 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1329 
1330 /* "_definitions/types.pxd":104
1331  * ctypedef int IndexType
1332  * ctypedef const int ConstIndexType
1333  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1334  *
1335  * # Used for both flags and integers used as signals, including negative integers
1336  */
1337 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1338 
1339 /* "_definitions/types.pxd":109
1340  * ctypedef int FlagType
1341  * ctypedef const int ConstFlagType
1342  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1343  *
1344  *
1345  */
1346 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1347 
1348 /* "_definitions/types.pxd":116
1349  * # ==============
1350  *
1351  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1352  * const double x,
1353  * const double kernel_param) nogil
1354  */
1355 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1356 
1357 /* "View.MemoryView":106
1358  *
1359  * @cname("__pyx_array")
1360  * cdef class array: # <<<<<<<<<<<<<<
1361  *
1362  * cdef:
1363  */
1364 struct __pyx_array_obj {
1365  PyObject_HEAD
1366  struct __pyx_vtabstruct_array *__pyx_vtab;
1367  char *data;
1368  Py_ssize_t len;
1369  char *format;
1370  int ndim;
1371  Py_ssize_t *_shape;
1372  Py_ssize_t *_strides;
1373  Py_ssize_t itemsize;
1374  PyObject *mode;
1375  PyObject *_format;
1376  void (*callback_free_data)(void *);
1377  int free_data;
1378  int dtype_is_object;
1379 };
1380 
1381 
1382 /* "View.MemoryView":280
1383  *
1384  * @cname('__pyx_MemviewEnum')
1385  * cdef class Enum(object): # <<<<<<<<<<<<<<
1386  * cdef object name
1387  * def __init__(self, name):
1388  */
1389 struct __pyx_MemviewEnum_obj {
1390  PyObject_HEAD
1391  PyObject *name;
1392 };
1393 
1394 
1395 /* "View.MemoryView":331
1396  *
1397  * @cname('__pyx_memoryview')
1398  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1399  *
1400  * cdef object obj
1401  */
1402 struct __pyx_memoryview_obj {
1403  PyObject_HEAD
1404  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1405  PyObject *obj;
1406  PyObject *_size;
1407  PyObject *_array_interface;
1408  PyThread_type_lock lock;
1409  __pyx_atomic_int acquisition_count[2];
1410  __pyx_atomic_int *acquisition_count_aligned_p;
1411  Py_buffer view;
1412  int flags;
1413  int dtype_is_object;
1414  __Pyx_TypeInfo *typeinfo;
1415 };
1416 
1417 
1418 /* "View.MemoryView":967
1419  *
1420  * @cname('__pyx_memoryviewslice')
1421  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1422  * "Internal class for passing memoryview slices to Python"
1423  *
1424  */
1425 struct __pyx_memoryviewslice_obj {
1426  struct __pyx_memoryview_obj __pyx_base;
1427  __Pyx_memviewslice from_slice;
1428  PyObject *from_object;
1429  PyObject *(*to_object_func)(char *);
1430  int (*to_dtype_func)(char *, PyObject *);
1431 };
1432 
1433 
1434 
1435 /* "View.MemoryView":106
1436  *
1437  * @cname("__pyx_array")
1438  * cdef class array: # <<<<<<<<<<<<<<
1439  *
1440  * cdef:
1441  */
1442 
1443 struct __pyx_vtabstruct_array {
1444  PyObject *(*get_memview)(struct __pyx_array_obj *);
1445 };
1446 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1447 
1448 
1449 /* "View.MemoryView":331
1450  *
1451  * @cname('__pyx_memoryview')
1452  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1453  *
1454  * cdef object obj
1455  */
1456 
1457 struct __pyx_vtabstruct_memoryview {
1458  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1459  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1460  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1461  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1462  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1463  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1464  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1465 };
1466 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1467 
1468 
1469 /* "View.MemoryView":967
1470  *
1471  * @cname('__pyx_memoryviewslice')
1472  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1473  * "Internal class for passing memoryview slices to Python"
1474  *
1475  */
1476 
1477 struct __pyx_vtabstruct__memoryviewslice {
1478  struct __pyx_vtabstruct_memoryview __pyx_base;
1479 };
1480 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1481 
1482 /* --- Runtime support code (head) --- */
1483 /* Refnanny.proto */
1484 #ifndef CYTHON_REFNANNY
1485  #define CYTHON_REFNANNY 0
1486 #endif
1487 #if CYTHON_REFNANNY
1488  typedef struct {
1489  void (*INCREF)(void*, PyObject*, int);
1490  void (*DECREF)(void*, PyObject*, int);
1491  void (*GOTREF)(void*, PyObject*, int);
1492  void (*GIVEREF)(void*, PyObject*, int);
1493  void* (*SetupContext)(const char*, int, const char*);
1494  void (*FinishContext)(void**);
1495  } __Pyx_RefNannyAPIStruct;
1496  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1497  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1498  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1499 #ifdef WITH_THREAD
1500  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1501  if (acquire_gil) {\
1502  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1503  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1504  PyGILState_Release(__pyx_gilstate_save);\
1505  } else {\
1506  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1507  }
1508 #else
1509  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1510  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1511 #endif
1512  #define __Pyx_RefNannyFinishContext()\
1513  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1514  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1515  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1516  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1517  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1518  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1519  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1520  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1521  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1522 #else
1523  #define __Pyx_RefNannyDeclarations
1524  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1525  #define __Pyx_RefNannyFinishContext()
1526  #define __Pyx_INCREF(r) Py_INCREF(r)
1527  #define __Pyx_DECREF(r) Py_DECREF(r)
1528  #define __Pyx_GOTREF(r)
1529  #define __Pyx_GIVEREF(r)
1530  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1531  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1532  #define __Pyx_XGOTREF(r)
1533  #define __Pyx_XGIVEREF(r)
1534 #endif
1535 #define __Pyx_XDECREF_SET(r, v) do {\
1536  PyObject *tmp = (PyObject *) r;\
1537  r = v; __Pyx_XDECREF(tmp);\
1538  } while (0)
1539 #define __Pyx_DECREF_SET(r, v) do {\
1540  PyObject *tmp = (PyObject *) r;\
1541  r = v; __Pyx_DECREF(tmp);\
1542  } while (0)
1543 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1544 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1545 
1546 /* PyObjectGetAttrStr.proto */
1547 #if CYTHON_USE_TYPE_SLOTS
1548 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1549 #else
1550 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1551 #endif
1552 
1553 /* GetBuiltinName.proto */
1554 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1555 
1556 /* RaiseDoubleKeywords.proto */
1557 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1558 
1559 /* ParseKeywords.proto */
1560 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1561  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1562  const char* function_name);
1563 
1564 /* RaiseArgTupleInvalid.proto */
1565 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1566  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1567 
1568 /* PyThreadStateGet.proto */
1569 #if CYTHON_FAST_THREAD_STATE
1570 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1571 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1572 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1573 #else
1574 #define __Pyx_PyThreadState_declare
1575 #define __Pyx_PyThreadState_assign
1576 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1577 #endif
1578 
1579 /* PyErrFetchRestore.proto */
1580 #if CYTHON_FAST_THREAD_STATE
1581 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1582 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1583 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1584 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1585 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1586 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1587 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1588 #if CYTHON_COMPILING_IN_CPYTHON
1589 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1590 #else
1591 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1592 #endif
1593 #else
1594 #define __Pyx_PyErr_Clear() PyErr_Clear()
1595 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1596 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1597 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1598 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1599 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1600 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1601 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1602 #endif
1603 
1604 /* Profile.proto */
1605 #ifndef CYTHON_PROFILE
1606 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1607  #define CYTHON_PROFILE 0
1608 #else
1609  #define CYTHON_PROFILE 1
1610 #endif
1611 #endif
1612 #ifndef CYTHON_TRACE_NOGIL
1613  #define CYTHON_TRACE_NOGIL 0
1614 #else
1615  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1616  #define CYTHON_TRACE 1
1617  #endif
1618 #endif
1619 #ifndef CYTHON_TRACE
1620  #define CYTHON_TRACE 0
1621 #endif
1622 #if CYTHON_TRACE
1623  #undef CYTHON_PROFILE_REUSE_FRAME
1624 #endif
1625 #ifndef CYTHON_PROFILE_REUSE_FRAME
1626  #define CYTHON_PROFILE_REUSE_FRAME 0
1627 #endif
1628 #if CYTHON_PROFILE || CYTHON_TRACE
1629  #include "compile.h"
1630  #include "frameobject.h"
1631  #include "traceback.h"
1632 #if PY_VERSION_HEX >= 0x030b00a6
1633  #ifndef Py_BUILD_CORE
1634  #define Py_BUILD_CORE 1
1635  #endif
1636  #include "internal/pycore_frame.h"
1637 #endif
1638  #if CYTHON_PROFILE_REUSE_FRAME
1639  #define CYTHON_FRAME_MODIFIER static
1640  #define CYTHON_FRAME_DEL(frame)
1641  #else
1642  #define CYTHON_FRAME_MODIFIER
1643  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1644  #endif
1645  #define __Pyx_TraceDeclarations\
1646  static PyCodeObject *__pyx_frame_code = NULL;\
1647  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1648  int __Pyx_use_tracing = 0;
1649  #define __Pyx_TraceFrameInit(codeobj)\
1650  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1651 #if PY_VERSION_HEX >= 0x030b00a2
1652  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1653  (unlikely((tstate)->cframe->use_tracing) &&\
1654  (!(check_tracing) || !(tstate)->tracing) &&\
1655  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1656  #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
1657  #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
1658 #elif PY_VERSION_HEX >= 0x030a00b1
1659  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1660  (unlikely((tstate)->cframe->use_tracing) &&\
1661  (!(check_tracing) || !(tstate)->tracing) &&\
1662  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1663  #define __Pyx_EnterTracing(tstate)\
1664  do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
1665  #define __Pyx_LeaveTracing(tstate)\
1666  do {\
1667  tstate->tracing--;\
1668  tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1669  || tstate->c_profilefunc != NULL);\
1670  } while (0)
1671 #else
1672  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1673  (unlikely((tstate)->use_tracing) &&\
1674  (!(check_tracing) || !(tstate)->tracing) &&\
1675  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1676  #define __Pyx_EnterTracing(tstate)\
1677  do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
1678  #define __Pyx_LeaveTracing(tstate)\
1679  do {\
1680  tstate->tracing--;\
1681  tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
1682  || tstate->c_profilefunc != NULL);\
1683  } while (0)
1684 #endif
1685  #ifdef WITH_THREAD
1686  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1687  if (nogil) {\
1688  if (CYTHON_TRACE_NOGIL) {\
1689  PyThreadState *tstate;\
1690  PyGILState_STATE state = PyGILState_Ensure();\
1691  tstate = __Pyx_PyThreadState_Current;\
1692  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1693  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1694  }\
1695  PyGILState_Release(state);\
1696  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1697  }\
1698  } else {\
1699  PyThreadState* tstate = PyThreadState_GET();\
1700  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1701  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1702  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1703  }\
1704  }
1705  #else
1706  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1707  { PyThreadState* tstate = PyThreadState_GET();\
1708  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1709  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1710  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1711  }\
1712  }
1713  #endif
1714  #define __Pyx_TraceException()\
1715  if (likely(!__Pyx_use_tracing)); else {\
1716  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1717  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1718  __Pyx_EnterTracing(tstate);\
1719  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1720  if (exc_info) {\
1721  if (CYTHON_TRACE && tstate->c_tracefunc)\
1722  tstate->c_tracefunc(\
1723  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1724  tstate->c_profilefunc(\
1725  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1726  Py_DECREF(exc_info);\
1727  }\
1728  __Pyx_LeaveTracing(tstate);\
1729  }\
1730  }
1731  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1732  PyObject *type, *value, *traceback;
1733  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1734  __Pyx_EnterTracing(tstate);
1735  if (CYTHON_TRACE && tstate->c_tracefunc)
1736  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1737  if (tstate->c_profilefunc)
1738  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1739  CYTHON_FRAME_DEL(frame);
1740  __Pyx_LeaveTracing(tstate);
1741  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1742  }
1743  #ifdef WITH_THREAD
1744  #define __Pyx_TraceReturn(result, nogil)\
1745  if (likely(!__Pyx_use_tracing)); else {\
1746  if (nogil) {\
1747  if (CYTHON_TRACE_NOGIL) {\
1748  PyThreadState *tstate;\
1749  PyGILState_STATE state = PyGILState_Ensure();\
1750  tstate = __Pyx_PyThreadState_Current;\
1751  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1752  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1753  }\
1754  PyGILState_Release(state);\
1755  }\
1756  } else {\
1757  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1758  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1759  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1760  }\
1761  }\
1762  }
1763  #else
1764  #define __Pyx_TraceReturn(result, nogil)\
1765  if (likely(!__Pyx_use_tracing)); else {\
1766  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1767  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1768  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1769  }\
1770  }
1771  #endif
1772  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1773  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1774 #else
1775  #define __Pyx_TraceDeclarations
1776  #define __Pyx_TraceFrameInit(codeobj)
1777  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1778  #define __Pyx_TraceException()
1779  #define __Pyx_TraceReturn(result, nogil)
1780 #endif
1781 #if CYTHON_TRACE
1782  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1783  int ret;
1784  PyObject *type, *value, *traceback;
1785  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1786  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1787  __Pyx_EnterTracing(tstate);
1788  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1789  __Pyx_LeaveTracing(tstate);
1790  if (likely(!ret)) {
1791  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1792  } else {
1793  Py_XDECREF(type);
1794  Py_XDECREF(value);
1795  Py_XDECREF(traceback);
1796  }
1797  return ret;
1798  }
1799  #ifdef WITH_THREAD
1800  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1801  if (likely(!__Pyx_use_tracing)); else {\
1802  if (nogil) {\
1803  if (CYTHON_TRACE_NOGIL) {\
1804  int ret = 0;\
1805  PyThreadState *tstate;\
1806  PyGILState_STATE state = PyGILState_Ensure();\
1807  tstate = __Pyx_PyThreadState_Current;\
1808  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1809  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1810  }\
1811  PyGILState_Release(state);\
1812  if (unlikely(ret)) goto_error;\
1813  }\
1814  } else {\
1815  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1816  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1817  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1818  if (unlikely(ret)) goto_error;\
1819  }\
1820  }\
1821  }
1822  #else
1823  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1824  if (likely(!__Pyx_use_tracing)); else {\
1825  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1826  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1827  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1828  if (unlikely(ret)) goto_error;\
1829  }\
1830  }
1831  #endif
1832 #else
1833  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1834 #endif
1835 
1836 /* PyDictVersioning.proto */
1837 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1838 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1839 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1840 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1841  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1842  (cache_var) = (value);
1843 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1844  static PY_UINT64_T __pyx_dict_version = 0;\
1845  static PyObject *__pyx_dict_cached_value = NULL;\
1846  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1847  (VAR) = __pyx_dict_cached_value;\
1848  } else {\
1849  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1850  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1851  }\
1852 }
1853 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1854 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1855 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1856 #else
1857 #define __PYX_GET_DICT_VERSION(dict) (0)
1858 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1859 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1860 #endif
1861 
1862 /* GetModuleGlobalName.proto */
1863 #if CYTHON_USE_DICT_VERSIONS
1864 #define __Pyx_GetModuleGlobalName(var, name) do {\
1865  static PY_UINT64_T __pyx_dict_version = 0;\
1866  static PyObject *__pyx_dict_cached_value = NULL;\
1867  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1868  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1869  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1870 } while(0)
1871 #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
1872  PY_UINT64_T __pyx_dict_version;\
1873  PyObject *__pyx_dict_cached_value;\
1874  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1875 } while(0)
1876 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1877 #else
1878 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1879 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1880 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1881 #endif
1882 
1883 /* PyFunctionFastCall.proto */
1884 #if CYTHON_FAST_PYCALL
1885 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1886  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1887 #if 1 || PY_VERSION_HEX < 0x030600B1
1888 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1889 #else
1890 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1891 #endif
1892 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1893  (sizeof(char [1 - 2*!(cond)]) - 1)
1894 #ifndef Py_MEMBER_SIZE
1895 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1896 #endif
1897 #if CYTHON_FAST_PYCALL
1898  static size_t __pyx_pyframe_localsplus_offset = 0;
1899  #include "frameobject.h"
1900 #if PY_VERSION_HEX >= 0x030b00a6
1901  #ifndef Py_BUILD_CORE
1902  #define Py_BUILD_CORE 1
1903  #endif
1904  #include "internal/pycore_frame.h"
1905 #endif
1906  #define __Pxy_PyFrame_Initialize_Offsets()\
1907  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1908  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1909  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1910  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1911 #endif // CYTHON_FAST_PYCALL
1912 #endif
1913 
1914 /* PyCFunctionFastCall.proto */
1915 #if CYTHON_FAST_PYCCALL
1916 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1917 #else
1918 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1919 #endif
1920 
1921 /* PyObjectCall.proto */
1922 #if CYTHON_COMPILING_IN_CPYTHON
1923 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1924 #else
1925 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1926 #endif
1927 
1928 /* RaiseTooManyValuesToUnpack.proto */
1929 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1930 
1931 /* RaiseNeedMoreValuesToUnpack.proto */
1932 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1933 
1934 /* IterFinish.proto */
1935 static CYTHON_INLINE int __Pyx_IterFinish(void);
1936 
1937 /* UnpackItemEndCheck.proto */
1938 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1939 
1940 /* GetItemInt.proto */
1941 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1942  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1943  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1944  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1945  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1946 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1947  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1948  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1949  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1950 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1951  int wraparound, int boundscheck);
1952 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1953  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1954  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1955  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1956 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1957  int wraparound, int boundscheck);
1958 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1959 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1960  int is_list, int wraparound, int boundscheck);
1961 
1962 /* PyObjectCallMethO.proto */
1963 #if CYTHON_COMPILING_IN_CPYTHON
1964 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1965 #endif
1966 
1967 /* PyObjectCallNoArg.proto */
1968 #if CYTHON_COMPILING_IN_CPYTHON
1969 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1970 #else
1971 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1972 #endif
1973 
1974 /* PyObjectCallOneArg.proto */
1975 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1976 
1977 /* PyObjectCall2Args.proto */
1978 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1979 
1980 /* IncludeStringH.proto */
1981 #include <string.h>
1982 
1983 /* BytesEquals.proto */
1984 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1985 
1986 /* RaiseException.proto */
1987 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1988 
1989 /* SliceObject.proto */
1990 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1991  __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1992 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
1993  PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1994  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1995  int has_cstart, int has_cstop, int wraparound);
1996 
1997 /* PyIntCompare.proto */
1998 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1999 
2000 /* MatrixMultiply.proto */
2001 #if PY_VERSION_HEX >= 0x03050000
2002  #define __Pyx_PyNumber_MatrixMultiply(x,y) PyNumber_MatrixMultiply(x,y)
2003  #define __Pyx_PyNumber_InPlaceMatrixMultiply(x,y) PyNumber_InPlaceMatrixMultiply(x,y)
2004 #else
2005 #define __Pyx_PyNumber_MatrixMultiply(x,y) __Pyx__PyNumber_MatrixMultiply(x, y, "@")
2006 static PyObject* __Pyx__PyNumber_MatrixMultiply(PyObject* x, PyObject* y, const char* op_name);
2007 static PyObject* __Pyx_PyNumber_InPlaceMatrixMultiply(PyObject* x, PyObject* y);
2008 #endif
2009 
2010 /* ObjectGetItem.proto */
2011 #if CYTHON_USE_TYPE_SLOTS
2012 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
2013 #else
2014 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2015 #endif
2016 
2017 /* SetItemInt.proto */
2018 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2019  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2020  __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2021  (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2022  __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2023 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2024 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2025  int is_list, int wraparound, int boundscheck);
2026 
2027 /* MemviewSliceInit.proto */
2028 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
2029 #define __Pyx_MEMVIEW_DIRECT 1
2030 #define __Pyx_MEMVIEW_PTR 2
2031 #define __Pyx_MEMVIEW_FULL 4
2032 #define __Pyx_MEMVIEW_CONTIG 8
2033 #define __Pyx_MEMVIEW_STRIDED 16
2034 #define __Pyx_MEMVIEW_FOLLOW 32
2035 #define __Pyx_IS_C_CONTIG 1
2036 #define __Pyx_IS_F_CONTIG 2
2037 static int __Pyx_init_memviewslice(
2038  struct __pyx_memoryview_obj *memview,
2039  int ndim,
2040  __Pyx_memviewslice *memviewslice,
2041  int memview_is_new_reference);
2042 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
2043  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2044 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
2045  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
2046 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
2047 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
2048 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
2049 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
2050 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
2051 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
2052 
2053 /* None.proto */
2054 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2055 
2056 /* ArgTypeTest.proto */
2057 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2058  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2059  __Pyx__ArgTypeTest(obj, type, name, exact))
2060 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2061 
2062 /* UnicodeEquals.proto */
2063 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2064 
2065 /* StrEquals.proto */
2066 #if PY_MAJOR_VERSION >= 3
2067 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2068 #else
2069 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2070 #endif
2071 
2072 /* UnaryNegOverflows.proto */
2073 #define UNARY_NEG_WOULD_OVERFLOW(x)\
2074  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2075 
2076 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2077 /* WriteUnraisableException.proto */
2078 static void __Pyx_WriteUnraisable(const char *name, int clineno,
2079  int lineno, const char *filename,
2080  int full_traceback, int nogil);
2081 
2082 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2083 /* GetAttr.proto */
2084 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2085 
2086 /* decode_c_string_utf16.proto */
2087 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
2088  int byteorder = 0;
2089  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2090 }
2091 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
2092  int byteorder = -1;
2093  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2094 }
2095 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
2096  int byteorder = 1;
2097  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
2098 }
2099 
2100 /* decode_c_string.proto */
2101 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
2102  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
2103  const char* encoding, const char* errors,
2104  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
2105 
2106 /* PyErrExceptionMatches.proto */
2107 #if CYTHON_FAST_THREAD_STATE
2108 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2109 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2110 #else
2111 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2112 #endif
2113 
2114 /* GetAttr3.proto */
2115 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2116 
2117 /* RaiseNoneIterError.proto */
2118 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2119 
2120 /* ExtTypeTest.proto */
2121 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2122 
2123 /* GetTopmostException.proto */
2124 #if CYTHON_USE_EXC_INFO_STACK
2125 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2126 #endif
2127 
2128 /* SaveResetException.proto */
2129 #if CYTHON_FAST_THREAD_STATE
2130 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2131 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2132 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2133 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2134 #else
2135 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2136 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2137 #endif
2138 
2139 /* GetException.proto */
2140 #if CYTHON_FAST_THREAD_STATE
2141 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2142 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2143 #else
2144 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2145 #endif
2146 
2147 /* SwapException.proto */
2148 #if CYTHON_FAST_THREAD_STATE
2149 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2150 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2151 #else
2152 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2153 #endif
2154 
2155 /* Import.proto */
2156 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2157 
2158 /* FastTypeChecks.proto */
2159 #if CYTHON_COMPILING_IN_CPYTHON
2160 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2161 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2162 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2163 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2164 #else
2165 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2166 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2167 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2168 #endif
2169 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2170 
2171 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2172 /* ListCompAppend.proto */
2173 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2174 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2175  PyListObject* L = (PyListObject*) list;
2176  Py_ssize_t len = Py_SIZE(list);
2177  if (likely(L->allocated > len)) {
2178  Py_INCREF(x);
2179  PyList_SET_ITEM(list, len, x);
2180  __Pyx_SET_SIZE(list, len + 1);
2181  return 0;
2182  }
2183  return PyList_Append(list, x);
2184 }
2185 #else
2186 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2187 #endif
2188 
2189 /* PyIntBinop.proto */
2190 #if !CYTHON_COMPILING_IN_PYPY
2191 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2192 #else
2193 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2194  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2195 #endif
2196 
2197 /* ListExtend.proto */
2198 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2199 #if CYTHON_COMPILING_IN_CPYTHON
2200  PyObject* none = _PyList_Extend((PyListObject*)L, v);
2201  if (unlikely(!none))
2202  return -1;
2203  Py_DECREF(none);
2204  return 0;
2205 #else
2206  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2207 #endif
2208 }
2209 
2210 /* ListAppend.proto */
2211 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2212 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2213  PyListObject* L = (PyListObject*) list;
2214  Py_ssize_t len = Py_SIZE(list);
2215  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2216  Py_INCREF(x);
2217  PyList_SET_ITEM(list, len, x);
2218  __Pyx_SET_SIZE(list, len + 1);
2219  return 0;
2220  }
2221  return PyList_Append(list, x);
2222 }
2223 #else
2224 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2225 #endif
2226 
2227 /* AssertionsEnabled.proto */
2228 #define __Pyx_init_assertions_enabled()
2229 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2230  #define __pyx_assertions_enabled() (1)
2231 #elif PY_VERSION_HEX < 0x03080000 || CYTHON_COMPILING_IN_PYPY || defined(Py_LIMITED_API)
2232  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2233 #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030900A6
2234  static int __pyx_assertions_enabled_flag;
2235  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2236  #undef __Pyx_init_assertions_enabled
2237  static void __Pyx_init_assertions_enabled(void) {
2238  __pyx_assertions_enabled_flag = ! _PyInterpreterState_GetConfig(__Pyx_PyThreadState_Current->interp)->optimization_level;
2239  }
2240 #else
2241  #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2242 #endif
2243 
2244 /* PySequenceContains.proto */
2245 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2246  int result = PySequence_Contains(seq, item);
2247  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2248 }
2249 
2250 /* ImportFrom.proto */
2251 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2252 
2253 /* HasAttr.proto */
2254 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2255 
2256 /* PyObject_GenericGetAttrNoDict.proto */
2257 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2258 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2259 #else
2260 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2261 #endif
2262 
2263 /* PyObject_GenericGetAttr.proto */
2264 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2265 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2266 #else
2267 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2268 #endif
2269 
2270 /* SetVTable.proto */
2271 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2272 
2273 /* PyObjectGetAttrStrNoError.proto */
2274 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2275 
2276 /* SetupReduce.proto */
2277 static int __Pyx_setup_reduce(PyObject* type_obj);
2278 
2279 /* FetchCommonType.proto */
2280 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2281 
2282 /* CythonFunctionShared.proto */
2283 #define __Pyx_CyFunction_USED 1
2284 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2285 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2286 #define __Pyx_CYFUNCTION_CCLASS 0x04
2287 #define __Pyx_CyFunction_GetClosure(f)\
2288  (((__pyx_CyFunctionObject *) (f))->func_closure)
2289 #define __Pyx_CyFunction_GetClassObj(f)\
2290  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2291 #define __Pyx_CyFunction_Defaults(type, f)\
2292  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2293 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2294  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2295 typedef struct {
2296  PyCFunctionObject func;
2297 #if PY_VERSION_HEX < 0x030500A0
2298  PyObject *func_weakreflist;
2299 #endif
2300  PyObject *func_dict;
2301  PyObject *func_name;
2302  PyObject *func_qualname;
2303  PyObject *func_doc;
2304  PyObject *func_globals;
2305  PyObject *func_code;
2306  PyObject *func_closure;
2307  PyObject *func_classobj;
2308  void *defaults;
2309  int defaults_pyobjects;
2310  size_t defaults_size; // used by FusedFunction for copying defaults
2311  int flags;
2312  PyObject *defaults_tuple;
2313  PyObject *defaults_kwdict;
2314  PyObject *(*defaults_getter)(PyObject *);
2315  PyObject *func_annotations;
2316 } __pyx_CyFunctionObject;
2317 static PyTypeObject *__pyx_CyFunctionType = 0;
2318 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2319 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2320  int flags, PyObject* qualname,
2321  PyObject *self,
2322  PyObject *module, PyObject *globals,
2323  PyObject* code);
2324 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2325  size_t size,
2326  int pyobjects);
2327 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2328  PyObject *tuple);
2329 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2330  PyObject *dict);
2331 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2332  PyObject *dict);
2333 static int __pyx_CyFunction_init(void);
2334 
2335 /* CythonFunction.proto */
2336 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2337  int flags, PyObject* qualname,
2338  PyObject *closure,
2339  PyObject *module, PyObject *globals,
2340  PyObject* code);
2341 
2342 /* CLineInTraceback.proto */
2343 #ifdef CYTHON_CLINE_IN_TRACEBACK
2344 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2345 #else
2346 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2347 #endif
2348 
2349 /* CodeObjectCache.proto */
2350 typedef struct {
2351  PyCodeObject* code_object;
2352  int code_line;
2353 } __Pyx_CodeObjectCacheEntry;
2354 struct __Pyx_CodeObjectCache {
2355  int count;
2356  int max_count;
2357  __Pyx_CodeObjectCacheEntry* entries;
2358 };
2359 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2360 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2361 static PyCodeObject *__pyx_find_code_object(int code_line);
2362 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2363 
2364 /* AddTraceback.proto */
2365 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2366  int py_line, const char *filename);
2367 
2368 #if PY_MAJOR_VERSION < 3
2369  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2370  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2371 #else
2372  #define __Pyx_GetBuffer PyObject_GetBuffer
2373  #define __Pyx_ReleaseBuffer PyBuffer_Release
2374 #endif
2375 
2376 
2377 /* BufferStructDeclare.proto */
2378 typedef struct {
2379  Py_ssize_t shape, strides, suboffsets;
2380 } __Pyx_Buf_DimInfo;
2381 typedef struct {
2382  size_t refcount;
2383  Py_buffer pybuffer;
2384 } __Pyx_Buffer;
2385 typedef struct {
2386  __Pyx_Buffer *rcbuffer;
2387  char *data;
2388  __Pyx_Buf_DimInfo diminfo[8];
2389 } __Pyx_LocalBuf_ND;
2390 
2391 /* MemviewSliceIsContig.proto */
2392 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2393 
2394 /* OverlappingSlices.proto */
2395 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2396  __Pyx_memviewslice *slice2,
2397  int ndim, size_t itemsize);
2398 
2399 /* Capsule.proto */
2400 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2401 
2402 /* GCCDiagnostics.proto */
2403 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2404 #define __Pyx_HAS_GCC_DIAGNOSTIC
2405 #endif
2406 
2407 /* IsLittleEndian.proto */
2408 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2409 
2410 /* BufferFormatCheck.proto */
2411 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2412 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2413  __Pyx_BufFmt_StackElem* stack,
2414  __Pyx_TypeInfo* type);
2415 
2416 /* TypeInfoCompare.proto */
2417 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2418 
2419 /* MemviewSliceValidateAndInit.proto */
2420 static int __Pyx_ValidateAndInit_memviewslice(
2421  int *axes_specs,
2422  int c_or_f_flag,
2423  int buf_flags,
2424  int ndim,
2425  __Pyx_TypeInfo *dtype,
2426  __Pyx_BufFmt_StackElem stack[],
2427  __Pyx_memviewslice *memviewslice,
2428  PyObject *original_obj);
2429 
2430 /* ObjectToMemviewSlice.proto */
2431 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *, int writable_flag);
2432 
2433 /* ObjectToMemviewSlice.proto */
2434 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag);
2435 
2436 /* ObjectToMemviewSlice.proto */
2437 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2438 
2439 /* ObjectToMemviewSlice.proto */
2440 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2441 
2442 /* MemviewSliceCopyTemplate.proto */
2443 static __Pyx_memviewslice
2444 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2445  const char *mode, int ndim,
2446  size_t sizeof_dtype, int contig_flag,
2447  int dtype_is_object);
2448 
2449 /* CIntToPy.proto */
2450 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2451 
2452 /* CIntFromPy.proto */
2453 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2454 
2455 /* CIntToPy.proto */
2456 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2457 
2458 /* CIntFromPy.proto */
2459 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2460 
2461 /* CIntFromPy.proto */
2462 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2463 
2464 /* CheckBinaryVersion.proto */
2465 static int __Pyx_check_binary_version(void);
2466 
2467 /* FunctionImport.proto */
2468 static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2469 
2470 /* InitStrings.proto */
2471 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2472 
2473 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2474 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2475 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2476 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2477 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2478 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2479 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2480 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2481 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2482 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2483 
2484 /* Module declarations from 'imate._definitions.types' */
2485 
2486 /* Module declarations from 'imate._c_basic_algebra.c_vector_operations' */
2487 
2488 /* Module declarations from 'imate._c_basic_algebra' */
2489 
2490 /* Module declarations from 'imate._linear_algebra.orthogonalization' */
2491 static void (*__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors)(float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const ); /*proto*/
2492 static void (*__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors)(double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const ); /*proto*/
2493 static void (*__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors)(long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const ); /*proto*/
2494 
2495 /* Module declarations from 'imate._linear_algebra.random_vectors' */
2496 static void (*__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors)(float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const ); /*proto*/
2497 static void (*__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors)(double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const ); /*proto*/
2498 static void (*__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors)(long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const ); /*proto*/
2499 
2500 /* Module declarations from 'imate._linear_algebra' */
2501 
2502 /* Module declarations from 'imate.traceinv._hutchinson_method' */
2503 static PyTypeObject *__pyx_array_type = 0;
2504 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2505 static PyTypeObject *__pyx_memoryview_type = 0;
2506 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2507 static PyObject *generic = 0;
2508 static PyObject *strided = 0;
2509 static PyObject *indirect = 0;
2510 static PyObject *contiguous = 0;
2511 static PyObject *indirect_contiguous = 0;
2512 static int __pyx_memoryview_thread_locks_used;
2513 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2514 static float __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_float(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
2515 static double __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_double(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
2516 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2517 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2518 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2519 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2520 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2521 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2522 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2523 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2524 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2525 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2526 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2527 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2528 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2529 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2530 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2531 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2532 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2533 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2534 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2535 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2536 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2537 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2538 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2539 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2540 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2541 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2542 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2543 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2544 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2545 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2546 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2547 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2548 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2549 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2550 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2551 #define __Pyx_MODULE_NAME "imate.traceinv._hutchinson_method"
2552 extern int __pyx_module_is_main_imate__traceinv___hutchinson_method;
2553 int __pyx_module_is_main_imate__traceinv___hutchinson_method = 0;
2554 
2555 /* Implementation of 'imate.traceinv._hutchinson_method' */
2556 static PyObject *__pyx_builtin_TypeError;
2557 static PyObject *__pyx_builtin_range;
2558 static PyObject *__pyx_builtin_RuntimeError;
2559 static PyObject *__pyx_builtin_ValueError;
2560 static PyObject *__pyx_builtin_MemoryError;
2561 static PyObject *__pyx_builtin_enumerate;
2562 static PyObject *__pyx_builtin_Ellipsis;
2563 static PyObject *__pyx_builtin_id;
2564 static PyObject *__pyx_builtin_IndexError;
2565 static const char __pyx_k_A[] = "A";
2566 static const char __pyx_k_B[] = "B";
2567 static const char __pyx_k_C[] = "C";
2568 static const char __pyx_k_E[] = "E";
2569 static const char __pyx_k_F[] = "F";
2570 static const char __pyx_k_O[] = "O";
2571 static const char __pyx_k_T[] = "T";
2572 static const char __pyx_k_c[] = "c";
2573 static const char __pyx_k_i[] = "i";
2574 static const char __pyx_k_p[] = "p";
2575 static const char __pyx_k_BE[] = "BE";
2576 static const char __pyx_k_cE[] = "cE";
2577 static const char __pyx_k_id[] = "id";
2578 static const char __pyx_k_AtA[] = "AtA";
2579 static const char __pyx_k_OpE[] = "OpE";
2580 static const char __pyx_k_abs[] = "abs";
2581 static const char __pyx_k_gen[] = "gen";
2582 static const char __pyx_k_nan[] = "nan";
2583 static const char __pyx_k_new[] = "__new__";
2584 static const char __pyx_k_nnz[] = "nnz";
2585 static const char __pyx_k_obj[] = "obj";
2586 static const char __pyx_k_base[] = "base";
2587 static const char __pyx_k_dict[] = "__dict__";
2588 static const char __pyx_k_gram[] = "gram";
2589 static const char __pyx_k_info[] = "info";
2590 static const char __pyx_k_main[] = "__main__";
2591 static const char __pyx_k_mode[] = "mode";
2592 static const char __pyx_k_name[] = "name";
2593 static const char __pyx_k_ndim[] = "ndim";
2594 static const char __pyx_k_pack[] = "pack";
2595 static const char __pyx_k_plot[] = "plot";
2596 static const char __pyx_k_size[] = "size";
2597 static const char __pyx_k_step[] = "step";
2598 static const char __pyx_k_stop[] = "stop";
2599 static const char __pyx_k_test[] = "__test__";
2600 static const char __pyx_k_time[] = "time";
2601 static const char __pyx_k_ASCII[] = "ASCII";
2602 static const char __pyx_k_class[] = "__class__";
2603 static const char __pyx_k_dtype[] = "dtype";
2604 static const char __pyx_k_empty[] = "empty";
2605 static const char __pyx_k_error[] = "error";
2606 static const char __pyx_k_flags[] = "flags";
2607 static const char __pyx_k_numpy[] = "numpy";
2608 static const char __pyx_k_order[] = "order";
2609 static const char __pyx_k_range[] = "range";
2610 static const char __pyx_k_scipy[] = "scipy";
2611 static const char __pyx_k_shape[] = "shape";
2612 static const char __pyx_k_start[] = "start";
2613 static const char __pyx_k_trace[] = "trace";
2614 static const char __pyx_k_zeros[] = "zeros";
2615 static const char __pyx_k_AinvpE[] = "AinvpE";
2616 static const char __pyx_k_device[] = "device";
2617 static const char __pyx_k_encode[] = "encode";
2618 static const char __pyx_k_format[] = "format";
2619 static const char __pyx_k_import[] = "__import__";
2620 static const char __pyx_k_matmul[] = "__matmul__";
2621 static const char __pyx_k_matrix[] = "matrix";
2622 static const char __pyx_k_method[] = "method";
2623 static const char __pyx_k_name_2[] = "__name__";
2624 static const char __pyx_k_pickle[] = "pickle";
2625 static const char __pyx_k_reduce[] = "__reduce__";
2626 static const char __pyx_k_solver[] = "solver";
2627 static const char __pyx_k_sparse[] = "sparse";
2628 static const char __pyx_k_square[] = "square";
2629 static const char __pyx_k_struct[] = "struct";
2630 static const char __pyx_k_unpack[] = "unpack";
2631 static const char __pyx_k_update[] = "update";
2632 static const char __pyx_k_density[] = "density";
2633 static const char __pyx_k_float32[] = "float32";
2634 static const char __pyx_k_float64[] = "float64";
2635 static const char __pyx_k_fortran[] = "fortran";
2636 static const char __pyx_k_get_nnz[] = "get_nnz";
2637 static const char __pyx_k_imatmul[] = "__imatmul__";
2638 static const char __pyx_k_memview[] = "memview";
2639 static const char __pyx_k_rmatmul[] = "__rmatmul__";
2640 static const char __pyx_k_samples[] = "samples";
2641 static const char __pyx_k_verbose[] = "verbose";
2642 static const char __pyx_k_version[] = "version";
2643 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2644 static const char __pyx_k_exponent[] = "exponent";
2645 static const char __pyx_k_getstate[] = "__getstate__";
2646 static const char __pyx_k_itemsize[] = "itemsize";
2647 static const char __pyx_k_pyx_type[] = "__pyx_type";
2648 static const char __pyx_k_setstate[] = "__setstate__";
2649 static const char __pyx_k_TypeError[] = "TypeError";
2650 static const char __pyx_k_converged[] = "converged";
2651 static const char __pyx_k_cpu_count[] = "cpu_count";
2652 static const char __pyx_k_data_type[] = "data_type";
2653 static const char __pyx_k_enumerate[] = "enumerate";
2654 static const char __pyx_k_pyx_state[] = "__pyx_state";
2655 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2656 static const char __pyx_k_version_2[] = "__version__";
2657 static const char __pyx_k_IndexError[] = "IndexError";
2658 static const char __pyx_k_ValueError[] = "ValueError";
2659 static const char __pyx_k_error_atol[] = "error_atol";
2660 static const char __pyx_k_error_rtol[] = "error_rtol";
2661 static const char __pyx_k_hutchinson[] = "hutchinson";
2662 static const char __pyx_k_isspmatrix[] = "isspmatrix";
2663 static const char __pyx_k_pyx_result[] = "__pyx_result";
2664 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2665 static const char __pyx_k_solver_tol[] = "solver_tol";
2666 static const char __pyx_k_MemoryError[] = "MemoryError";
2667 static const char __pyx_k_PickleError[] = "PickleError";
2668 static const char __pyx_k_convergence[] = "convergence";
2669 static const char __pyx_k_get_density[] = "get_density";
2670 static const char __pyx_k_num_threads[] = "num_threads";
2671 static const char __pyx_k_return_info[] = "return_info";
2672 static const char __pyx_k_vector_size[] = "vector_size";
2673 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2674 static const char __pyx_k_memoryview_E[] = "memoryview_E";
2675 static const char __pyx_k_num_outliers[] = "num_outliers";
2676 static const char __pyx_k_operator_dot[] = "_operator_dot";
2677 static const char __pyx_k_perf_counter[] = "perf_counter";
2678 static const char __pyx_k_process_time[] = "process_time";
2679 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2680 static const char __pyx_k_samples_mean[] = "samples_mean";
2681 static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
2682 static const char __pyx_k_stringsource[] = "stringsource";
2683 static const char __pyx_k_alg_wall_time[] = "alg_wall_time";
2684 static const char __pyx_k_assume_matrix[] = "assume_matrix";
2685 static const char __pyx_k_cpu_proc_time[] = "cpu_proc_time";
2686 static const char __pyx_k_linear_solver[] = "linear_solver";
2687 static const char __pyx_k_num_inquiries[] = "num_inquiries";
2688 static const char __pyx_k_orthogonalize[] = "orthogonalize";
2689 static const char __pyx_k_print_summary[] = "print_summary";
2690 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2691 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2692 static const char __pyx_k_tot_wall_time[] = "tot_wall_time";
2693 static const char __pyx_k_absolute_error[] = "absolute_error";
2694 static const char __pyx_k_data_type_name[] = "data_type_name";
2695 static const char __pyx_k_linear_algebra[] = "_linear_algebra";
2696 static const char __pyx_k_relative_error[] = "relative_error";
2697 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2698 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2699 static const char __pyx_k_check_arguments[] = "check_arguments";
2700 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2701 static const char __pyx_k_max_num_samples[] = "max_num_samples";
2702 static const char __pyx_k_min_num_samples[] = "min_num_samples";
2703 static const char __pyx_k_multiprocessing[] = "multiprocessing";
2704 static const char __pyx_k_num_cpu_threads[] = "num_cpu_threads";
2705 static const char __pyx_k_num_gpu_devices[] = "num_gpu_devices";
2706 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2707 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2708 static const char __pyx_k_confidence_level[] = "confidence_level";
2709 static const char __pyx_k_num_samples_used[] = "num_samples_used";
2710 static const char __pyx_k_plot_convergence[] = "plot_convergence";
2711 static const char __pyx_k_average_estimates[] = "average_estimates";
2712 static const char __pyx_k_check_convergence[] = "check_convergence";
2713 static const char __pyx_k_convergence_tools[] = "_convergence_tools";
2714 static const char __pyx_k_hutchinson_method[] = "hutchinson_method";
2715 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2716 static const char __pyx_k_AtA_cannot_be_None[] = "\"AtA\" cannot be None.";
2717 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2718 static const char __pyx_k_get_data_type_name[] = "get_data_type_name";
2719 static const char __pyx_k_init_alg_wall_time[] = "init_alg_wall_time";
2720 static const char __pyx_k_init_cpu_proc_time[] = "init_cpu_proc_time";
2721 static const char __pyx_k_init_tot_wall_time[] = "init_tot_wall_time";
2722 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2723 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2724 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2725 static const char __pyx_k_num_processed_samples[] = "num_processed_samples";
2726 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2727 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2728 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2729 static const char __pyx_k_hutchinson_method_float[] = "_hutchinson_method_float";
2730 static const char __pyx_k_num_gpu_multiprocessors[] = "num_gpu_multiprocessors";
2731 static const char __pyx_k_samples_processed_order[] = "samples_processed_order";
2732 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2733 static const char __pyx_k_hutchinson_method_double[] = "_hutchinson_method_double";
2734 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2735 static const char __pyx_k_hutchinson_method_line_37[] = "hutchinson_method (line 37)";
2736 static const char __pyx_k_processed_samples_indices[] = "processed_samples_indices";
2737 static const char __pyx_k_outlier_significance_level[] = "outlier_significance_level";
2738 static const char __pyx_k_hutchinson_method_utilities[] = "_hutchinson_method_utilities";
2739 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2740 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2741 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2742 static const char __pyx_k_Trace_of_matrix_or_linear_opera[] = "\n Trace of matrix or linear operator using stochastic Lanczos quadrature\n method.\n\n If `C` is `None`, given the matrices :math:`\\mathbf{A}` and\n :math:`\\mathbf{B}` and the integer exponent :math:`p`, the following is\n computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\right).\n\n If `B` is `None`, it is assumed that :math:`\\mathbf{B}` is the identity\n matrix.\n\n If `C` is not `None`, given the matrix :math:`\\mathbf{C}`, the following\n is instead computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\mathbf{C}\n \\mathbf{A}^{-p} \\right).\n\n If ``gram`` is `True`, then :math:`\\mathbf{A}` in the above is replaced by\n the Gramian matrix :math:`\\mathbf{A}^{\\intercal} \\mathbf{A}`. Namely, if\n `C` is `None`:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right),\n\n and if `C` is not `None`,\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\mathbf{C}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right).\n\n Parameters\n ----------\n\n A : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. If ``gram`` is `True`, the matrix can be\n non-square.\n\n .. note::\n\n In the Hutchinson method, the matrix cannot be a type of\n :class:`Matrix` or :class:`imate.AffineMatrixFunction` classes.\n\n gram : bool, default=False\n If `True`, the trace of the Gramian matrix,\n :math:`(\\mathbf{A}^{\\intercal}\\mathbf{A})^p`, is computed. The\n Gramian matrix itself is not directly computed. If `False`, the\n trace of :math:`\\mathbf{A}^p` is computed.\n\n p : float, default=1.0\n The integer exponent :math:`p` in :math:`\\mathbf{A}^{-p}`.\n\n return_info : bool, default=False\n If `True`, this functio""n also returns a dictionary containing\n information about the inner computation, such as process time,\n algorithm settings, etc.\n\n B : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `B` should be the same size and type of `A`.\n if `B` is `None`, it is assumed that `B` is the identity matrix.\n\n C : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `C` should be the same size and type of `A`.\n\n assume_matrix : str {'gen', 'sym', 'pos', 'sym_pos'}, default: 'gen'\n Type of matrix `A`:\n\n * ``gen`` assumes `A` is a generic matrix.\n * ``sym`` assumes `A` is symmetric.\n * ``pos`` assumes `A` is positive-definite.\n * ``sym_pos`` assumes `A` is symmetric and positive-definite.\n\n min_num_samples : int, default=10\n The minimum number of Monte-Carlo samples. If the convergence criterion\n is reached before finishing the minimum number of iterations, the\n iterations are forced to continue till the minimum number of iterations\n is finished. This value should be smaller than\n ``maximum_num_samples``.\n\n max_num_samples : int, default=50\n The maximum number of Monte-Carlo samples. If the convergence criterion\n is not reached by the maximum number of iterations, the iterations are\n forced to stop. This value should be larger than\n ``minimum_num_samples``.\n\n error_atol : float, default=None\n Tolerance of the absolute error of convergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the convergence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n error_rtol : float, default=None\n Tolerance of the relative error of con""vergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the convergence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n confidence_level : float, default=0.95\n Confidence level of error, which is a number between `0` and `1`. The\n error of convergence of the population of samples is defined by their\n standard deviation times the Z-score, which depends on the confidence\n level. See notes below for details.\n\n outlier_significance_level : float, default=0.001\n One minus the confidence level of the uncertainty of the outliers of\n the output samples. This is a number between `0` and `1`.\n\n solver_tol : float, default=1e-6\n Tolerance of solving linear system.\n\n orthogonalize : int, default=0\n If `True`, it orthogonalizes the set of random vectors used for\n Monte-Carlo sampling. This might lead to a better estimation of the\n output.\n\n num_threads : int, default=0\n Number of processor threads to employ for parallel computation on CPU.\n If set to `0` or a number larger than the available number of threads,\n all threads of the processor are used. The parallelization is performed\n over the Monte-Carlo iterations.\n\n verbose : bool, default=False\n Prints extra information about the computations.\n\n plot : bool, default=False\n Plots convergence of samples. For this, the packages `matplotlib` and\n `seaborn` should be installed. If no display is available (such as\n running this code on remote machines), the plots are saved as an `SVG`\n file in the current directory.\n\n Returns\n -------\n\n traceinv : float or numpy.array\n Tr""ace of inverse of matrix.\n\n info : dict\n (Only if ``return_info`` is `True`) A dictionary of information with\n the following.\n\n * ``matrix``:\n * ``data_type``: `str`, {`float32`, `float64`, `float128`}. Type of\n the matrix data.\n * ``gram``: `bool`, whether the matrix `A` or its Gramian is\n considered.\n * ``exponent``: `float`, the exponent `p` in :math:`\\mathbf{A}^p`.\n * ``assume_matrix``: `str`, {`gen`, `sym`, `pos`, `sym_pos`},\n determines the type of matrix `A`.\n * ``size``: (int, int) The size of matrix `A`.\n * ``sparse``: `bool`, whether the matrix `A` is sparse or dense.\n * ``nnz``: `int`, if `A` is sparse, the number of non-zero elements\n of `A`.\n * ``density``: `float`, if `A` is sparse, the density of `A`, which\n is the `nnz` divided by size squared.\n * ``num_inquiries``: `int`, the size of inquiries of each parameter\n of the linear operator `A`. If `A` is a matrix, this is always\n `1`. If `A` is a type of :class:`AffineMatrixFunction`, this\n value is the number of :math:`t_i` parameters.\n\n * ``convergence``:\n * ``converged``: `bool`, whether the Monte-Carlo sampling\n converged.\n * ``min_num_samples``: `int`, the minimum number of Monte-Carlo\n iterations.\n * ``max_num_samples``: `int`, the maximum number of Monte-Carlo\n iterations.\n * ``num_outliers``: `int`, number of outliers found during search\n for outliers among the array of output.\n * ``num_samples_used``: `int`, number of Monte-Carlo samples used\n to produce the output. This is the total number of iterations\n minus the number of outliers.\n * ``samples``: `array` [`float`], an array of the si""ze\n `max_num_samples`. The first few entries (`num_samples_used`) of\n this array are the output results of the Monte-Carlo sampling.\n The average of these samples is the final result. The rest of\n this array is `nan`.\n * ``samples_mean``: `float`, mean of the `samples` array, excluding\n the `nan` values.\n * ``samples_processed_order``: `array` [`int`], in parallel\n processing, samples are processed in non-sequential order. This\n array, which has the same size as `samples`, keeps track of the\n order in which each sample is processed.\n\n * ``error``:\n * ``absolute_error``: `float`, the absolute error of the\n convergence of samples.\n * ``confidence_level``: `float`, the confidence level used to\n calculate the error from standard deviation of samples.\n * ``error_atol``: `float`, the tolerance of absolute error of the\n convergence of samples.\n * ``error_rtol``: `float`, the tolerance of relative error of the\n convergence of samples.\n * ``outlier_significance_level``: `float`, the significance level\n used to determine the outliers in samples.\n * ``relative_error``: `float`, the relative error of the\n convergence of samples.\n\n * ``device``:\n * ``num_cpu_threads``: `int`, number of CPU threads used in shared\n memory parallel processing.\n * ``num_gpu_devices``: `int`, number of GPU devices used in the\n multi-GPU (GPU farm) computation.\n * ``num_gpu_multiprocessors``: `int`, number of GPU\n multi-processors.\n * ``num_gpu_threads_per_multiprocessor``: `int`, number of GPU\n threads on each GPU multi-processor.\n\n * ``time``:\n * ``tot_wall_time``: `float`"", total elapsed time of computation.\n * ``alg_wall_time``: `float`, elapsed time of computation during\n only the algorithm execution.\n * ``cpu_proc_time``: `float`, the CPU processing time of\n computation.\n\n * ``solver``:\n * ``version``: `str`, version of imate.\n * ``method``: 'hutchinson'.\n * ``solver_tol``: `float`, tolerance of solving linear system.\n * ``orthogonalize``: `bool`, orthogonalization flag.\n\n Raises\n ------\n\n ImportError\n If the package has not been compiled with GPU support, but ``gpu`` is\n set to `True`. To resolve the issue, set ``gpu`` to `False` to be able\n to use the existing installation. Alternatively, export the\n environment variable ``USE_CUDA=1`` and recompile the source code of\n the package.\n\n See Also\n --------\n\n imate.logdet\n imate.trace\n imate.schatten\n\n Notes\n -----\n\n **Computational Complexity:**\n\n This method uses the Hutchinson, which is a randomized algorithm. The\n computational complexity of this method is\n\n .. math::\n\n \\mathcal{O}((\\rho n^2s),\n\n where :math:`n` is the matrix size, :math:`\\rho` is the density of\n sparse matrix (for dense matrix, :math:`\\rho=1`), and :math:`s` is the\n number of samples (set with ``min_num_samples`` and ``max_num_samples``).\n\n This method can be used on very large matrices (:math:`n > 2^{12}`). The\n solution is an approximation.\n\n **Convergence criterion:**\n\n Let :math:`n_{\\min}` and :math:`n_{\\max}` be the minimum and maximum\n number of iterations respectively defined by ``min_num_samples`` and\n ``max_num_samples``. The iterations terminate at\n :math:`n_{\\min} \\leq i \\leq n_{\\max}` where :math:`i` is the\n iteration counter. The iterations stop earlier at :math:`i < n_{\\max}` if\n the convergence error of the mean of t""he samples is satisfied, as follows.\n\n Suppose :math:`s(j)` and :math:`\\sigma(i)` are respectively the mean and\n standard deviation of samples after :math:`j` iterations. The error of\n convergence, :math:`e(j)`, is defined by\n\n .. math::\n\n e(j) = \\frac{\\sigma(j)}{\\sqrt{j}} Z\n\n where :math:`Z` is the Z-score defined by\n\n .. math::\n\n Z = \\sqrt{2} \\mathrm{erf}^{-1}(\\phi).\n\n In the above, :math:`\\phi` is the confidence level and set by\n ``confidence_level`` argument, and :math:`\\mathrm{erf}^{-1}` is the\n inverse error function. A confidence level of 95%, for instance, means that\n the Z-score is 1.96, which means the confidence interval is\n :math:`\\pm 1.96 \\sigma`.\n\n The termination criterion is\n\n .. math::\n\n e(j) < \\epsilon_a + s(j) \\epsilon_r,\n\n where :math:`\\epsilon_{a}` and :math:`\\epsilon_r` are the absolute and\n relative error tolerances respectively, and they are set by ``error_atol``\n and ``error_rtol``.\n\n **Plotting:**\n\n If ``plot`` is set to `True`, it plots the convergence of samples and their\n relative error.\n\n * If no graphical backend exists (such as running the code on a remote\n server or manually disabling the X11 backend), the plot will not be\n shown, rather, it will be saved as an ``svg`` file in the current\n directory.\n * If the executable ``latex`` is available on ``PATH``, the plot is\n rendered using :math:`\\rm\\LaTeX` and it may take slightly longer to\n produce the plot.\n * If :math:`\\rm\\LaTeX` is not installed, it uses any available San-Serif\n font to render the plot.\n\n To manually disable interactive plot display and save the plot as\n ``svg`` instead, add the following at the very beginning of your code\n before importing :mod:`imate`:\n\n .. code-block:: python\n\n >>> import os\n >>> os.environ['IMATE_NO_DISPLAY'] = 'True'\n\n References""\n ----------\n\n * `Ubaru, S., Chen, J., and Saad, Y. (2017)\n <https://www-users.cs.umn.edu/~saad/PDF/ys-2016-04.pdf>`_,\n Fast Estimation of :math:`\\mathrm{tr}(F(A))` Via Stochastic Lanczos\n Quadrature, SIAM J. Matrix Anal. Appl., 38(4), 1075-1099.\n\n Examples\n --------\n\n **Basic Usage:**\n\n Compute the trace of :math:`\\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Import packages\n >>> from imate import toeplitz, traceinv\n\n >>> # Generate a sample matrix\n >>> A = toeplitz(2, 1, size=100)\n\n >>> # Compute trace of inverse\n >>> traceinv(A, p=2, method='hutchinson')\n 24.73726368966402\n\n Compute the trace of :math:`(\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson')\n 17.751659383784748\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> B = toeplitz(4, 3, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B)\n 99.8817360381704\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2} \\mathbf{C}\n \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> C = toeplitz(5, 4, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B, C=C)\n 124.45436379980006\n\n Compute the trace of :math:`\\mathbf{B} (\\mathbf{A}^{\\intercal}\n \\mathbf{A})^{-2} \\mathbf{C} (\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson', B=B, C=C)\n 5.517453125230929\n\n **Verbose output:**\n\n By setting ``verbose`` to `True`,"" useful info about the process is\n printed.\n\n .. literalinclude:: ../_static/data/imate.traceinv.hutchinson-verbose.txt\n :language: python\n\n **Output information:**\n\n Print information about the inner computation:\n\n .. code-block:: python\n\n >>> ti, info = traceinv(A, method='hutchinson', return_info=True)\n >>> print(ti)\n 50.059307947603585\n\n >>> # Print dictionary neatly using pprint\n >>> from pprint import pprint\n >>> pprint(info)\n {\n 'matrix': {\n 'assume_matrix': 'gen',\n 'data_type': b'float64',\n 'density': 0.0199,\n 'exponent': 1,\n 'gram': False,\n 'nnz': 199,\n 'num_inquiries': 1,\n 'size': (100, 100),\n 'sparse': True\n },\n 'convergence': {\n 'converged': False,\n 'max_num_samples': 50,\n 'min_num_samples': 10,\n 'num_outliers': 0,\n 'num_samples_used': 50,\n 'samples': array([52.237154, ..., 51.37932704]),\n 'samples_mean': 50.059307947603585,\n 'samples_processed_order': array([ 0, ..., 49])\n },\n 'error': {\n 'absolute_error': 0.8111131801161796,\n 'confidence_level': 0.95,\n 'error_atol': 0.0,\n 'error_rtol': 0.01,\n 'outlier_significance_level': 0.001,\n 'relative_error': 0.016203044216375525\n },\n 'solver': {\n 'method': 'hutchinson',\n 'orthogonalize': True,\n 'solver_tol': 1e-06,\n 'version': '0.16.0'\n },\n 'device': {\n 'num_cpu_threads': 8,\n 'num_gpu_devices': 0,\n 'num_gpu_multiprocessors': 0,\n '""num_gpu_threads_per_multiprocessor': 0\n },\n 'time': {\n 'alg_wall_time': 0.03236744087189436,\n 'cpu_proc_time': 0.047695197999999994,\n 'tot_wall_time': 0.033352302853018045\n }\n }\n\n **Large matrix:**\n\n Compute the trace of :math:`\\mathbf{A}^{-1}` for a very large sparse\n matrix using at least `100` samples.\n\n .. code-block:: python\n :emphasize-lines: 5, 6, 7\n\n >>> # Create a symmetric positive-definite matrix of size one million.\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n\n >>> # Approximate trace using hutchinson method\n >>> ti, info = traceinv(A, method='hutchinson', solver_tol=1e-4,\n ... assume_matrix='sym_pos', min_num_samples=100,\n ... max_num_samples=200, return_info=True)\n >>> print(ti)\n 333292.3226031165\n\n >>> # Find the time it took to compute the above\n >>> print(info['time'])\n {\n 'tot_wall_time': 175.93423152901232,\n 'alg_wall_time': 119.86316476506181,\n 'cpu_proc_time': 572.180877451\n }\n\n Compare the result of the above approximation with the exact solution of\n the trace using the analytic relation for Toeplitz matrix. See\n :func:`imate.sample_matrices.toeplitz_traceinv` for details.\n\n .. code-block:: python\n\n >>> from imate.sample_matrices import toeplitz_traceinv\n >>> toeplitz_traceinv(2, 1, size=1000000, gram=True)\n 333333.2222222222\n\n It can be seen that the error of approximation is :math:`0.012 \\%`. This\n accuracy is remarkable considering that the computation on such a large\n matrix took on 119 seconds. Computing the trace of such a large matrix\n using any of the exact methods (such as ``exact`` or ``eigenvalue``) is\n infeasible.\n\n **Plotting:**\n\n By setting ``plot`` to `True`, plots ""of samples during Monte-Carlo\n iterations and the convergence of their mean are generated.\n\n .. code-block:: python\n\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n >>> traceinv(A, method='hutchinson', assume_matrix='sym_pos',\n ... solver_tol=1e-4, min_num_samples=50, max_num_samples=150,\n ... error_rtol=2e-4, confidence_level=0.95,\n ... outlier_significance_level=0.001, plot=True)\n\n .. image:: ../_static/images/plots/traceinv_hutchinson_convergence.png\n :align: center\n :class: custom-dark\n\n In the left plot, the samples are shown in circles and the cumulative mean\n of the samples is shown by a solid black curve. The shaded area corresponds\n to the 95% confidence interval :math:`\\pm 1.96 \\sigma`, which is set by\n ``confidence_level=0.95``. The samples outside the interval of 99.9% are\n considered outliers, which is set by the significance level\n ``outlier_significance_level=0.001``.\n\n In the right plot, the darker shaded area in the interval :math:`[0, 50]`\n shows the minimum number of samples and is set by ``min_num_samples=50``.\n The iterations do not stop till the minimum number of iterations is passed.\n We can observe that sampling is terminated after 140 iterations where the\n relative error of samples reaches 0.02% since we set ``error_rtol=2e-4``.\n The lighter shaded area in the interval :math:`[140, 150]` corresponds to\n the iterations that were not performed to reach the specified maximum\n iterations by ``max_num_samples=150``.\n ";
2743 static const char __pyx_k_linear_algebra_matrix_utilities[] = "_linear_algebra.matrix_utilities";
2744 static const char __pyx_k_trace_estimator_trace_estimator[] = "_trace_estimator.trace_estimator_plot_utilities";
2745 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2746 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2747 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2748 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2749 static const char __pyx_k_Data_type_should_be_either_float[] = "Data type should be either \"float32\" or \"float64\"";
2750 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2751 static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))";
2752 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2753 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2754 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2755 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2756 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2757 static const char __pyx_k_imate_traceinv__hutchinson_metho[] = "imate/traceinv/_hutchinson_method.pyx";
2758 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2759 static const char __pyx_k_num_gpu_threads_per_multiprocess[] = "num_gpu_threads_per_multiprocessor";
2760 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2761 static const char __pyx_k_imate_traceinv__hutchinson_metho_2[] = "imate.traceinv._hutchinson_method";
2762 static PyObject *__pyx_n_s_A;
2763 static PyObject *__pyx_n_s_ASCII;
2764 static PyObject *__pyx_n_s_AinvpE;
2765 static PyObject *__pyx_n_s_AtA;
2766 static PyObject *__pyx_kp_u_AtA_cannot_be_None;
2767 static PyObject *__pyx_n_s_B;
2768 static PyObject *__pyx_n_s_BE;
2769 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2770 static PyObject *__pyx_n_s_C;
2771 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2772 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2773 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2774 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2775 static PyObject *__pyx_kp_u_Data_type_should_be_either_float;
2776 static PyObject *__pyx_n_s_E;
2777 static PyObject *__pyx_n_s_Ellipsis;
2778 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2779 static PyObject *__pyx_n_u_F;
2780 static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
2781 static PyObject *__pyx_n_s_IndexError;
2782 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2783 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2784 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2785 static PyObject *__pyx_n_s_MemoryError;
2786 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2787 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2788 static PyObject *__pyx_n_b_O;
2789 static PyObject *__pyx_n_s_OpE;
2790 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2791 static PyObject *__pyx_n_s_PickleError;
2792 static PyObject *__pyx_n_s_RuntimeError;
2793 static PyObject *__pyx_n_s_T;
2794 static PyObject *__pyx_kp_u_Trace_of_matrix_or_linear_opera;
2795 static PyObject *__pyx_n_s_TypeError;
2796 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2797 static PyObject *__pyx_n_s_ValueError;
2798 static PyObject *__pyx_n_s_View_MemoryView;
2799 static PyObject *__pyx_n_s_abs;
2800 static PyObject *__pyx_n_u_absolute_error;
2801 static PyObject *__pyx_n_s_alg_wall_time;
2802 static PyObject *__pyx_n_u_alg_wall_time;
2803 static PyObject *__pyx_n_s_allocate_buffer;
2804 static PyObject *__pyx_n_s_assume_matrix;
2805 static PyObject *__pyx_n_u_assume_matrix;
2806 static PyObject *__pyx_n_s_average_estimates;
2807 static PyObject *__pyx_n_s_base;
2808 static PyObject *__pyx_n_s_c;
2809 static PyObject *__pyx_n_u_c;
2810 static PyObject *__pyx_n_s_cE;
2811 static PyObject *__pyx_n_s_check_arguments;
2812 static PyObject *__pyx_n_s_check_convergence;
2813 static PyObject *__pyx_n_s_class;
2814 static PyObject *__pyx_n_s_cline_in_traceback;
2815 static PyObject *__pyx_n_s_confidence_level;
2816 static PyObject *__pyx_n_u_confidence_level;
2817 static PyObject *__pyx_kp_s_contiguous_and_direct;
2818 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2819 static PyObject *__pyx_n_s_converged;
2820 static PyObject *__pyx_n_u_converged;
2821 static PyObject *__pyx_n_u_convergence;
2822 static PyObject *__pyx_n_s_convergence_tools;
2823 static PyObject *__pyx_n_s_cpu_count;
2824 static PyObject *__pyx_n_s_cpu_proc_time;
2825 static PyObject *__pyx_n_u_cpu_proc_time;
2826 static PyObject *__pyx_n_u_data_type;
2827 static PyObject *__pyx_n_s_data_type_name;
2828 static PyObject *__pyx_n_u_density;
2829 static PyObject *__pyx_n_u_device;
2830 static PyObject *__pyx_n_s_dict;
2831 static PyObject *__pyx_n_s_dtype;
2832 static PyObject *__pyx_n_s_dtype_is_object;
2833 static PyObject *__pyx_n_s_empty;
2834 static PyObject *__pyx_n_s_encode;
2835 static PyObject *__pyx_n_s_enumerate;
2836 static PyObject *__pyx_n_s_error;
2837 static PyObject *__pyx_n_u_error;
2838 static PyObject *__pyx_n_s_error_atol;
2839 static PyObject *__pyx_n_u_error_atol;
2840 static PyObject *__pyx_n_s_error_rtol;
2841 static PyObject *__pyx_n_u_error_rtol;
2842 static PyObject *__pyx_n_u_exponent;
2843 static PyObject *__pyx_n_s_flags;
2844 static PyObject *__pyx_n_b_float32;
2845 static PyObject *__pyx_n_s_float32;
2846 static PyObject *__pyx_n_b_float64;
2847 static PyObject *__pyx_n_s_float64;
2848 static PyObject *__pyx_n_s_format;
2849 static PyObject *__pyx_n_s_fortran;
2850 static PyObject *__pyx_n_u_fortran;
2851 static PyObject *__pyx_n_u_gen;
2852 static PyObject *__pyx_n_s_get_data_type_name;
2853 static PyObject *__pyx_n_s_get_density;
2854 static PyObject *__pyx_n_s_get_nnz;
2855 static PyObject *__pyx_n_s_getstate;
2856 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2857 static PyObject *__pyx_n_s_gram;
2858 static PyObject *__pyx_n_u_gram;
2859 static PyObject *__pyx_n_u_hutchinson;
2860 static PyObject *__pyx_n_s_hutchinson_method;
2861 static PyObject *__pyx_n_s_hutchinson_method_double;
2862 static PyObject *__pyx_n_s_hutchinson_method_float;
2863 static PyObject *__pyx_kp_u_hutchinson_method_line_37;
2864 static PyObject *__pyx_n_s_hutchinson_method_utilities;
2865 static PyObject *__pyx_n_s_i;
2866 static PyObject *__pyx_n_s_id;
2867 static PyObject *__pyx_kp_s_imate_traceinv__hutchinson_metho;
2868 static PyObject *__pyx_n_s_imate_traceinv__hutchinson_metho_2;
2869 static PyObject *__pyx_n_s_imatmul;
2870 static PyObject *__pyx_n_s_import;
2871 static PyObject *__pyx_n_s_info;
2872 static PyObject *__pyx_n_s_init_alg_wall_time;
2873 static PyObject *__pyx_n_s_init_cpu_proc_time;
2874 static PyObject *__pyx_n_s_init_tot_wall_time;
2875 static PyObject *__pyx_n_s_isspmatrix;
2876 static PyObject *__pyx_n_s_itemsize;
2877 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2878 static PyObject *__pyx_n_s_linear_algebra;
2879 static PyObject *__pyx_n_s_linear_algebra_matrix_utilities;
2880 static PyObject *__pyx_n_s_linear_solver;
2881 static PyObject *__pyx_n_s_main;
2882 static PyObject *__pyx_n_s_matmul;
2883 static PyObject *__pyx_n_u_matrix;
2884 static PyObject *__pyx_n_s_max_num_samples;
2885 static PyObject *__pyx_n_u_max_num_samples;
2886 static PyObject *__pyx_n_s_memoryview_E;
2887 static PyObject *__pyx_n_s_memview;
2888 static PyObject *__pyx_n_u_method;
2889 static PyObject *__pyx_n_s_min_num_samples;
2890 static PyObject *__pyx_n_u_min_num_samples;
2891 static PyObject *__pyx_n_s_mode;
2892 static PyObject *__pyx_n_s_multiprocessing;
2893 static PyObject *__pyx_n_s_name;
2894 static PyObject *__pyx_n_s_name_2;
2895 static PyObject *__pyx_n_s_nan;
2896 static PyObject *__pyx_n_s_ndim;
2897 static PyObject *__pyx_n_s_new;
2898 static PyObject *__pyx_n_u_nnz;
2899 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2900 static PyObject *__pyx_n_u_num_cpu_threads;
2901 static PyObject *__pyx_n_u_num_gpu_devices;
2902 static PyObject *__pyx_n_u_num_gpu_multiprocessors;
2903 static PyObject *__pyx_n_u_num_gpu_threads_per_multiprocess;
2904 static PyObject *__pyx_n_u_num_inquiries;
2905 static PyObject *__pyx_n_s_num_outliers;
2906 static PyObject *__pyx_n_u_num_outliers;
2907 static PyObject *__pyx_n_s_num_processed_samples;
2908 static PyObject *__pyx_n_s_num_samples_used;
2909 static PyObject *__pyx_n_u_num_samples_used;
2910 static PyObject *__pyx_n_s_num_threads;
2911 static PyObject *__pyx_n_s_numpy;
2912 static PyObject *__pyx_n_s_obj;
2913 static PyObject *__pyx_n_s_operator_dot;
2914 static PyObject *__pyx_n_s_order;
2915 static PyObject *__pyx_n_s_orthogonalize;
2916 static PyObject *__pyx_n_u_orthogonalize;
2917 static PyObject *__pyx_n_s_outlier_significance_level;
2918 static PyObject *__pyx_n_u_outlier_significance_level;
2919 static PyObject *__pyx_n_s_p;
2920 static PyObject *__pyx_n_s_pack;
2921 static PyObject *__pyx_n_s_perf_counter;
2922 static PyObject *__pyx_n_s_pickle;
2923 static PyObject *__pyx_n_s_plot;
2924 static PyObject *__pyx_n_s_plot_convergence;
2925 static PyObject *__pyx_n_s_print_summary;
2926 static PyObject *__pyx_n_s_process_time;
2927 static PyObject *__pyx_n_s_processed_samples_indices;
2928 static PyObject *__pyx_n_s_pyx_PickleError;
2929 static PyObject *__pyx_n_s_pyx_checksum;
2930 static PyObject *__pyx_n_s_pyx_getbuffer;
2931 static PyObject *__pyx_n_s_pyx_result;
2932 static PyObject *__pyx_n_s_pyx_state;
2933 static PyObject *__pyx_n_s_pyx_type;
2934 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2935 static PyObject *__pyx_n_s_pyx_vtable;
2936 static PyObject *__pyx_n_s_range;
2937 static PyObject *__pyx_n_s_reduce;
2938 static PyObject *__pyx_n_s_reduce_cython;
2939 static PyObject *__pyx_n_s_reduce_ex;
2940 static PyObject *__pyx_n_u_relative_error;
2941 static PyObject *__pyx_n_s_return_info;
2942 static PyObject *__pyx_n_s_rmatmul;
2943 static PyObject *__pyx_n_s_samples;
2944 static PyObject *__pyx_n_u_samples;
2945 static PyObject *__pyx_n_u_samples_mean;
2946 static PyObject *__pyx_n_u_samples_processed_order;
2947 static PyObject *__pyx_n_s_scipy;
2948 static PyObject *__pyx_n_s_scipy_sparse;
2949 static PyObject *__pyx_n_s_setstate;
2950 static PyObject *__pyx_n_s_setstate_cython;
2951 static PyObject *__pyx_n_s_shape;
2952 static PyObject *__pyx_n_s_size;
2953 static PyObject *__pyx_n_u_size;
2954 static PyObject *__pyx_n_u_solver;
2955 static PyObject *__pyx_n_s_solver_tol;
2956 static PyObject *__pyx_n_u_solver_tol;
2957 static PyObject *__pyx_n_u_sparse;
2958 static PyObject *__pyx_n_s_square;
2959 static PyObject *__pyx_n_s_start;
2960 static PyObject *__pyx_n_s_step;
2961 static PyObject *__pyx_n_s_stop;
2962 static PyObject *__pyx_kp_s_strided_and_direct;
2963 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2964 static PyObject *__pyx_kp_s_strided_and_indirect;
2965 static PyObject *__pyx_kp_s_stringsource;
2966 static PyObject *__pyx_n_s_struct;
2967 static PyObject *__pyx_n_s_test;
2968 static PyObject *__pyx_n_s_time;
2969 static PyObject *__pyx_n_u_time;
2970 static PyObject *__pyx_n_s_tot_wall_time;
2971 static PyObject *__pyx_n_u_tot_wall_time;
2972 static PyObject *__pyx_n_s_trace;
2973 static PyObject *__pyx_n_s_trace_estimator_trace_estimator;
2974 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2975 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2976 static PyObject *__pyx_n_s_unpack;
2977 static PyObject *__pyx_n_s_update;
2978 static PyObject *__pyx_n_s_vector_size;
2979 static PyObject *__pyx_n_s_verbose;
2980 static PyObject *__pyx_n_u_version;
2981 static PyObject *__pyx_n_s_version_2;
2982 static PyObject *__pyx_n_s_zeros;
2983 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_hutchinson_method(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_return_info, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_verbose, PyObject *__pyx_v_plot); /* proto */
2984 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads); /* proto */
2985 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads); /* proto */
2986 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_6_operator_dot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_p, PyObject *__pyx_v_gram, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_B, PyObject *__pyx_v_E); /* proto */
2987 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2988 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2989 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2990 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2991 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2992 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2993 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2994 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2995 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2996 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2997 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2998 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2999 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3000 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3001 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3002 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3003 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3004 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3005 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3006 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3007 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3008 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3009 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3010 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3011 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3012 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3013 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3014 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3015 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3016 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3017 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3018 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3019 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3020 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3021 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3022 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3023 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3024 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3025 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3026 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3027 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3028 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3029 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3030 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3031 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3032 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3033 static PyObject *__pyx_float_0_95;
3034 static PyObject *__pyx_float_1eneg_2;
3035 static PyObject *__pyx_float_1eneg_6;
3036 static PyObject *__pyx_float_0_001;
3037 static PyObject *__pyx_int_0;
3038 static PyObject *__pyx_int_1;
3039 static PyObject *__pyx_int_10;
3040 static PyObject *__pyx_int_50;
3041 static PyObject *__pyx_int_112105877;
3042 static PyObject *__pyx_int_136983863;
3043 static PyObject *__pyx_int_184977713;
3044 static PyObject *__pyx_int_neg_1;
3045 static PyObject *__pyx_codeobj_;
3046 static PyObject *__pyx_slice__4;
3047 static PyObject *__pyx_tuple__2;
3048 static PyObject *__pyx_tuple__6;
3049 static PyObject *__pyx_tuple__8;
3050 static PyObject *__pyx_tuple__9;
3051 static PyObject *__pyx_tuple__10;
3052 static PyObject *__pyx_tuple__11;
3053 static PyObject *__pyx_tuple__12;
3054 static PyObject *__pyx_tuple__13;
3055 static PyObject *__pyx_tuple__14;
3056 static PyObject *__pyx_tuple__15;
3057 static PyObject *__pyx_tuple__16;
3058 static PyObject *__pyx_tuple__17;
3059 static PyObject *__pyx_tuple__18;
3060 static PyObject *__pyx_tuple__19;
3061 static PyObject *__pyx_tuple__20;
3062 static PyObject *__pyx_tuple__21;
3063 static PyObject *__pyx_tuple__22;
3064 static PyObject *__pyx_tuple__23;
3065 static PyObject *__pyx_tuple__24;
3066 static PyObject *__pyx_tuple__26;
3067 static PyObject *__pyx_tuple__27;
3068 static PyObject *__pyx_tuple__28;
3069 static PyObject *__pyx_tuple__29;
3070 static PyObject *__pyx_tuple__30;
3071 static PyObject *__pyx_tuple__31;
3072 static PyObject *__pyx_tuple__32;
3073 static PyObject *__pyx_tuple__33;
3074 static PyObject *__pyx_tuple__34;
3075 static PyObject *__pyx_tuple__35;
3076 static PyObject *__pyx_tuple__36;
3077 static PyObject *__pyx_tuple__37;
3078 static PyObject *__pyx_codeobj__3;
3079 static PyObject *__pyx_codeobj__5;
3080 static PyObject *__pyx_codeobj__7;
3081 static PyObject *__pyx_codeobj__25;
3082 /* Late includes */
3083 
3084 /* "imate/traceinv/_hutchinson_method.pyx":37
3085  * # =================
3086  *
3087  * def hutchinson_method( # <<<<<<<<<<<<<<
3088  * A,
3089  * gram=False,
3090  */
3091 
3092 /* Python wrapper */
3093 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_1hutchinson_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3094 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_hutchinson_method[] = "hutchinson_method(A, gram=False, p=1, return_info=False, B=None, C=None, assume_matrix=u'gen', min_num_samples=10, max_num_samples=50, error_atol=None, error_rtol=1e-2, confidence_level=0.95, outlier_significance_level=0.001, solver_tol=1e-6, orthogonalize=True, num_threads=0, verbose=False, plot=False)\n\n Trace of matrix or linear operator using stochastic Lanczos quadrature\n method.\n\n If `C` is `None`, given the matrices :math:`\\mathbf{A}` and\n :math:`\\mathbf{B}` and the integer exponent :math:`p`, the following is\n computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\right).\n\n If `B` is `None`, it is assumed that :math:`\\mathbf{B}` is the identity\n matrix.\n\n If `C` is not `None`, given the matrix :math:`\\mathbf{C}`, the following\n is instead computed:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B} \\mathbf{A}^{-p} \\mathbf{C}\n \\mathbf{A}^{-p} \\right).\n\n If ``gram`` is `True`, then :math:`\\mathbf{A}` in the above is replaced by\n the Gramian matrix :math:`\\mathbf{A}^{\\intercal} \\mathbf{A}`. Namely, if\n `C` is `None`:\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right),\n\n and if `C` is not `None`,\n\n .. math::\n\n \\mathrm{trace} \\left(\\mathbf{B}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\mathbf{C}\n (\\mathbf{A}^{\\intercal}\\mathbf{A})^{-p} \\right).\n\n Parameters\n ----------\n\n A : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. If ``gram`` is `True`, the matrix can be\n non-square.\n\n .. note::\n\n In the Hutchinson method, the matrix cannot be a type of\n :class:`Matrix` or :class:`imate.AffineMatrixFunction` classes.\n\n gram : bool, default=False\n If `True`, the trace of the Gramian matrix,\n :math:`(\\mathbf{A}^{\\intercal}\\mathbf{A})^p`, is comput""ed. The\n Gramian matrix itself is not directly computed. If `False`, the\n trace of :math:`\\mathbf{A}^p` is computed.\n\n p : float, default=1.0\n The integer exponent :math:`p` in :math:`\\mathbf{A}^{-p}`.\n\n return_info : bool, default=False\n If `True`, this function also returns a dictionary containing\n information about the inner computation, such as process time,\n algorithm settings, etc.\n\n B : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `B` should be the same size and type of `A`.\n if `B` is `None`, it is assumed that `B` is the identity matrix.\n\n C : numpy.ndarray, scipy.sparse\n A sparse or dense matrix. `C` should be the same size and type of `A`.\n\n assume_matrix : str {'gen', 'sym', 'pos', 'sym_pos'}, default: 'gen'\n Type of matrix `A`:\n\n * ``gen`` assumes `A` is a generic matrix.\n * ``sym`` assumes `A` is symmetric.\n * ``pos`` assumes `A` is positive-definite.\n * ``sym_pos`` assumes `A` is symmetric and positive-definite.\n\n min_num_samples : int, default=10\n The minimum number of Monte-Carlo samples. If the convergence criterion\n is reached before finishing the minimum number of iterations, the\n iterations are forced to continue till the minimum number of iterations\n is finished. This value should be smaller than\n ``maximum_num_samples``.\n\n max_num_samples : int, default=50\n The maximum number of Monte-Carlo samples. If the convergence criterion\n is not reached by the maximum number of iterations, the iterations are\n forced to stop. This value should be larger than\n ``minimum_num_samples``.\n\n error_atol : float, default=None\n Tolerance of the absolute error of convergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the conver""gence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n error_rtol : float, default=None\n Tolerance of the relative error of convergence of the output. Once the\n error of convergence reaches ``error_atol + error_rtol * output``, the\n iteration is terminated. If the convergence criterion is not met by the\n tolerance, then the iterations continue till reaching\n ``max_num_samples`` iterations. If `None`, the termination criterion\n does not depend on this parameter.\n\n confidence_level : float, default=0.95\n Confidence level of error, which is a number between `0` and `1`. The\n error of convergence of the population of samples is defined by their\n standard deviation times the Z-score, which depends on the confidence\n level. See notes below for details.\n\n outlier_significance_level : float, default=0.001\n One minus the confidence level of the uncertainty of the outliers of\n the output samples. This is a number between `0` and `1`.\n\n solver_tol : float, default=1e-6\n Tolerance of solving linear system.\n\n orthogonalize : int, default=0\n If `True`, it orthogonalizes the set of random vectors used for\n Monte-Carlo sampling. This might lead to a better estimation of the\n output.\n\n num_threads : int, default=0\n Number of processor threads to employ for parallel computation on CPU.\n If set to `0` or a number larger than the available number of threads,\n all threads of the processor are used. The parallelization is performed\n over the Monte-Carlo iterations.\n\n verbose : bool, default=False\n Prints extra information about the computations.\n\n plot : bool, default=False\n Plots convergence of samples. For this"", the packages `matplotlib` and\n `seaborn` should be installed. If no display is available (such as\n running this code on remote machines), the plots are saved as an `SVG`\n file in the current directory.\n\n Returns\n -------\n\n traceinv : float or numpy.array\n Trace of inverse of matrix.\n\n info : dict\n (Only if ``return_info`` is `True`) A dictionary of information with\n the following.\n\n * ``matrix``:\n * ``data_type``: `str`, {`float32`, `float64`, `float128`}. Type of\n the matrix data.\n * ``gram``: `bool`, whether the matrix `A` or its Gramian is\n considered.\n * ``exponent``: `float`, the exponent `p` in :math:`\\mathbf{A}^p`.\n * ``assume_matrix``: `str`, {`gen`, `sym`, `pos`, `sym_pos`},\n determines the type of matrix `A`.\n * ``size``: (int, int) The size of matrix `A`.\n * ``sparse``: `bool`, whether the matrix `A` is sparse or dense.\n * ``nnz``: `int`, if `A` is sparse, the number of non-zero elements\n of `A`.\n * ``density``: `float`, if `A` is sparse, the density of `A`, which\n is the `nnz` divided by size squared.\n * ``num_inquiries``: `int`, the size of inquiries of each parameter\n of the linear operator `A`. If `A` is a matrix, this is always\n `1`. If `A` is a type of :class:`AffineMatrixFunction`, this\n value is the number of :math:`t_i` parameters.\n\n * ``convergence``:\n * ``converged``: `bool`, whether the Monte-Carlo sampling\n converged.\n * ``min_num_samples``: `int`, the minimum number of Monte-Carlo\n iterations.\n * ``max_num_samples``: `int`, the maximum number of Monte-Carlo\n iterations.\n * ``num_outliers``: `int`, number of outliers found during search\n ""for outliers among the array of output.\n * ``num_samples_used``: `int`, number of Monte-Carlo samples used\n to produce the output. This is the total number of iterations\n minus the number of outliers.\n * ``samples``: `array` [`float`], an array of the size\n `max_num_samples`. The first few entries (`num_samples_used`) of\n this array are the output results of the Monte-Carlo sampling.\n The average of these samples is the final result. The rest of\n this array is `nan`.\n * ``samples_mean``: `float`, mean of the `samples` array, excluding\n the `nan` values.\n * ``samples_processed_order``: `array` [`int`], in parallel\n processing, samples are processed in non-sequential order. This\n array, which has the same size as `samples`, keeps track of the\n order in which each sample is processed.\n\n * ``error``:\n * ``absolute_error``: `float`, the absolute error of the\n convergence of samples.\n * ``confidence_level``: `float`, the confidence level used to\n calculate the error from standard deviation of samples.\n * ``error_atol``: `float`, the tolerance of absolute error of the\n convergence of samples.\n * ``error_rtol``: `float`, the tolerance of relative error of the\n convergence of samples.\n * ``outlier_significance_level``: `float`, the significance level\n used to determine the outliers in samples.\n * ``relative_error``: `float`, the relative error of the\n convergence of samples.\n\n * ``device``:\n * ``num_cpu_threads``: `int`, number of CPU threads used in shared\n memory parallel processing.\n * ``num_gpu_devices``: `int`, number of GPU devices used in the\n multi-GPU (GPU far""m) computation.\n * ``num_gpu_multiprocessors``: `int`, number of GPU\n multi-processors.\n * ``num_gpu_threads_per_multiprocessor``: `int`, number of GPU\n threads on each GPU multi-processor.\n\n * ``time``:\n * ``tot_wall_time``: `float`, total elapsed time of computation.\n * ``alg_wall_time``: `float`, elapsed time of computation during\n only the algorithm execution.\n * ``cpu_proc_time``: `float`, the CPU processing time of\n computation.\n\n * ``solver``:\n * ``version``: `str`, version of imate.\n * ``method``: 'hutchinson'.\n * ``solver_tol``: `float`, tolerance of solving linear system.\n * ``orthogonalize``: `bool`, orthogonalization flag.\n\n Raises\n ------\n\n ImportError\n If the package has not been compiled with GPU support, but ``gpu`` is\n set to `True`. To resolve the issue, set ``gpu`` to `False` to be able\n to use the existing installation. Alternatively, export the\n environment variable ``USE_CUDA=1`` and recompile the source code of\n the package.\n\n See Also\n --------\n\n imate.logdet\n imate.trace\n imate.schatten\n\n Notes\n -----\n\n **Computational Complexity:**\n\n This method uses the Hutchinson, which is a randomized algorithm. The\n computational complexity of this method is\n\n .. math::\n\n \\mathcal{O}((\\rho n^2s),\n\n where :math:`n` is the matrix size, :math:`\\rho` is the density of\n sparse matrix (for dense matrix, :math:`\\rho=1`), and :math:`s` is the\n number of samples (set with ``min_num_samples`` and ``max_num_samples``).\n\n This method can be used on very large matrices (:math:`n > 2^{12}`). The\n solution is an approximation.\n\n **Convergence criterion:**\n\n Let :math:`n_{\\min}` and :math:`n_{\\max}` be the minimum and maximum\n number of ""iterations respectively defined by ``min_num_samples`` and\n ``max_num_samples``. The iterations terminate at\n :math:`n_{\\min} \\leq i \\leq n_{\\max}` where :math:`i` is the\n iteration counter. The iterations stop earlier at :math:`i < n_{\\max}` if\n the convergence error of the mean of the samples is satisfied, as follows.\n\n Suppose :math:`s(j)` and :math:`\\sigma(i)` are respectively the mean and\n standard deviation of samples after :math:`j` iterations. The error of\n convergence, :math:`e(j)`, is defined by\n\n .. math::\n\n e(j) = \\frac{\\sigma(j)}{\\sqrt{j}} Z\n\n where :math:`Z` is the Z-score defined by\n\n .. math::\n\n Z = \\sqrt{2} \\mathrm{erf}^{-1}(\\phi).\n\n In the above, :math:`\\phi` is the confidence level and set by\n ``confidence_level`` argument, and :math:`\\mathrm{erf}^{-1}` is the\n inverse error function. A confidence level of 95%, for instance, means that\n the Z-score is 1.96, which means the confidence interval is\n :math:`\\pm 1.96 \\sigma`.\n\n The termination criterion is\n\n .. math::\n\n e(j) < \\epsilon_a + s(j) \\epsilon_r,\n\n where :math:`\\epsilon_{a}` and :math:`\\epsilon_r` are the absolute and\n relative error tolerances respectively, and they are set by ``error_atol``\n and ``error_rtol``.\n\n **Plotting:**\n\n If ``plot`` is set to `True`, it plots the convergence of samples and their\n relative error.\n\n * If no graphical backend exists (such as running the code on a remote\n server or manually disabling the X11 backend), the plot will not be\n shown, rather, it will be saved as an ``svg`` file in the current\n directory.\n * If the executable ``latex`` is available on ``PATH``, the plot is\n rendered using :math:`\\rm\\LaTeX` and it may take slightly longer to\n produce the plot.\n * If :math:`\\rm\\LaTeX` is not installed, it uses any available San-Serif\n font to render the plot.""\n\n To manually disable interactive plot display and save the plot as\n ``svg`` instead, add the following at the very beginning of your code\n before importing :mod:`imate`:\n\n .. code-block:: python\n\n >>> import os\n >>> os.environ['IMATE_NO_DISPLAY'] = 'True'\n\n References\n ----------\n\n * `Ubaru, S., Chen, J., and Saad, Y. (2017)\n <https://www-users.cs.umn.edu/~saad/PDF/ys-2016-04.pdf>`_,\n Fast Estimation of :math:`\\mathrm{tr}(F(A))` Via Stochastic Lanczos\n Quadrature, SIAM J. Matrix Anal. Appl., 38(4), 1075-1099.\n\n Examples\n --------\n\n **Basic Usage:**\n\n Compute the trace of :math:`\\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Import packages\n >>> from imate import toeplitz, traceinv\n\n >>> # Generate a sample matrix\n >>> A = toeplitz(2, 1, size=100)\n\n >>> # Compute trace of inverse\n >>> traceinv(A, p=2, method='hutchinson')\n 24.73726368966402\n\n Compute the trace of :math:`(\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson')\n 17.751659383784748\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> B = toeplitz(4, 3, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B)\n 99.8817360381704\n\n Compute the trace of :math:`\\mathbf{B} \\mathbf{A}^{-2} \\mathbf{C}\n \\mathbf{A}^{-2}`:\n\n .. code-block:: python\n\n >>> # Generate another sample matrix\n >>> C = toeplitz(5, 4, size=100)\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, p=2, method='hutchinson', B=B, C=C)\n 124.45436379980006\n\n Compute the trace of :math:`\\mathbf{B} (\\mathbf{A}^{\\intercal}\n ""\\mathbf{A})^{-2} \\mathbf{C} (\\mathbf{A}^{\\intercal} \\mathbf{A})^{-2}`:\n\n .. code-block:: python\n\n >>> # Using Gramian matrix of A\n >>> traceinv(A, gram=True, p=2, method='hutchinson', B=B, C=C)\n 5.517453125230929\n\n **Verbose output:**\n\n By setting ``verbose`` to `True`, useful info about the process is\n printed.\n\n .. literalinclude:: ../_static/data/imate.traceinv.hutchinson-verbose.txt\n :language: python\n\n **Output information:**\n\n Print information about the inner computation:\n\n .. code-block:: python\n\n >>> ti, info = traceinv(A, method='hutchinson', return_info=True)\n >>> print(ti)\n 50.059307947603585\n\n >>> # Print dictionary neatly using pprint\n >>> from pprint import pprint\n >>> pprint(info)\n {\n 'matrix': {\n 'assume_matrix': 'gen',\n 'data_type': b'float64',\n 'density': 0.0199,\n 'exponent': 1,\n 'gram': False,\n 'nnz': 199,\n 'num_inquiries': 1,\n 'size': (100, 100),\n 'sparse': True\n },\n 'convergence': {\n 'converged': False,\n 'max_num_samples': 50,\n 'min_num_samples': 10,\n 'num_outliers': 0,\n 'num_samples_used': 50,\n 'samples': array([52.237154, ..., 51.37932704]),\n 'samples_mean': 50.059307947603585,\n 'samples_processed_order': array([ 0, ..., 49])\n },\n 'error': {\n 'absolute_error': 0.8111131801161796,\n 'confidence_level': 0.95,\n 'error_atol': 0.0,\n 'error_rtol': 0.01,\n 'outlier_significance_level': 0.001,\n 'relative_error': 0.016203044216375525\n },\n 'solver': {\n 'method'"": 'hutchinson',\n 'orthogonalize': True,\n 'solver_tol': 1e-06,\n 'version': '0.16.0'\n },\n 'device': {\n 'num_cpu_threads': 8,\n 'num_gpu_devices': 0,\n 'num_gpu_multiprocessors': 0,\n 'num_gpu_threads_per_multiprocessor': 0\n },\n 'time': {\n 'alg_wall_time': 0.03236744087189436,\n 'cpu_proc_time': 0.047695197999999994,\n 'tot_wall_time': 0.033352302853018045\n }\n }\n\n **Large matrix:**\n\n Compute the trace of :math:`\\mathbf{A}^{-1}` for a very large sparse\n matrix using at least `100` samples.\n\n .. code-block:: python\n :emphasize-lines: 5, 6, 7\n\n >>> # Create a symmetric positive-definite matrix of size one million.\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n\n >>> # Approximate trace using hutchinson method\n >>> ti, info = traceinv(A, method='hutchinson', solver_tol=1e-4,\n ... assume_matrix='sym_pos', min_num_samples=100,\n ... max_num_samples=200, return_info=True)\n >>> print(ti)\n 333292.3226031165\n\n >>> # Find the time it took to compute the above\n >>> print(info['time'])\n {\n 'tot_wall_time': 175.93423152901232,\n 'alg_wall_time': 119.86316476506181,\n 'cpu_proc_time': 572.180877451\n }\n\n Compare the result of the above approximation with the exact solution of\n the trace using the analytic relation for Toeplitz matrix. See\n :func:`imate.sample_matrices.toeplitz_traceinv` for details.\n\n .. code-block:: python\n\n >>> from imate.sample_matrices import toeplitz_traceinv\n >>> toeplitz_traceinv(2, 1, size=1000000, gram=True)\n 333333.2222222222\n\n It can be seen that the error of approximation is :math:`0.012 \\%`. Th""is\n accuracy is remarkable considering that the computation on such a large\n matrix took on 119 seconds. Computing the trace of such a large matrix\n using any of the exact methods (such as ``exact`` or ``eigenvalue``) is\n infeasible.\n\n **Plotting:**\n\n By setting ``plot`` to `True`, plots of samples during Monte-Carlo\n iterations and the convergence of their mean are generated.\n\n .. code-block:: python\n\n >>> A = toeplitz(2, 1, size=1000000, gram=True)\n >>> traceinv(A, method='hutchinson', assume_matrix='sym_pos',\n ... solver_tol=1e-4, min_num_samples=50, max_num_samples=150,\n ... error_rtol=2e-4, confidence_level=0.95,\n ... outlier_significance_level=0.001, plot=True)\n\n .. image:: ../_static/images/plots/traceinv_hutchinson_convergence.png\n :align: center\n :class: custom-dark\n\n In the left plot, the samples are shown in circles and the cumulative mean\n of the samples is shown by a solid black curve. The shaded area corresponds\n to the 95% confidence interval :math:`\\pm 1.96 \\sigma`, which is set by\n ``confidence_level=0.95``. The samples outside the interval of 99.9% are\n considered outliers, which is set by the significance level\n ``outlier_significance_level=0.001``.\n\n In the right plot, the darker shaded area in the interval :math:`[0, 50]`\n shows the minimum number of samples and is set by ``min_num_samples=50``.\n The iterations do not stop till the minimum number of iterations is passed.\n We can observe that sampling is terminated after 140 iterations where the\n relative error of samples reaches 0.02% since we set ``error_rtol=2e-4``.\n The lighter shaded area in the interval :math:`[140, 150]` corresponds to\n the iterations that were not performed to reach the specified maximum\n iterations by ``max_num_samples=150``.\n ";
3095 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_1hutchinson_method = {"hutchinson_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_1hutchinson_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_hutchinson_method};
3096 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_1hutchinson_method(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3097  PyObject *__pyx_v_A = 0;
3098  PyObject *__pyx_v_gram = 0;
3099  PyObject *__pyx_v_p = 0;
3100  PyObject *__pyx_v_return_info = 0;
3101  PyObject *__pyx_v_B = 0;
3102  PyObject *__pyx_v_C = 0;
3103  PyObject *__pyx_v_assume_matrix = 0;
3104  PyObject *__pyx_v_min_num_samples = 0;
3105  PyObject *__pyx_v_max_num_samples = 0;
3106  PyObject *__pyx_v_error_atol = 0;
3107  PyObject *__pyx_v_error_rtol = 0;
3108  PyObject *__pyx_v_confidence_level = 0;
3109  PyObject *__pyx_v_outlier_significance_level = 0;
3110  PyObject *__pyx_v_solver_tol = 0;
3111  PyObject *__pyx_v_orthogonalize = 0;
3112  PyObject *__pyx_v_num_threads = 0;
3113  PyObject *__pyx_v_verbose = 0;
3114  PyObject *__pyx_v_plot = 0;
3115  int __pyx_lineno = 0;
3116  const char *__pyx_filename = NULL;
3117  int __pyx_clineno = 0;
3118  PyObject *__pyx_r = 0;
3119  __Pyx_RefNannyDeclarations
3120  __Pyx_RefNannySetupContext("hutchinson_method (wrapper)", 0);
3121  {
3122  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_gram,&__pyx_n_s_p,&__pyx_n_s_return_info,&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_assume_matrix,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_solver_tol,&__pyx_n_s_orthogonalize,&__pyx_n_s_num_threads,&__pyx_n_s_verbose,&__pyx_n_s_plot,0};
3123  PyObject* values[18] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
3124 
3125  /* "imate/traceinv/_hutchinson_method.pyx":39
3126  * def hutchinson_method(
3127  * A,
3128  * gram=False, # <<<<<<<<<<<<<<
3129  * p=1,
3130  * return_info=False,
3131  */
3132  values[1] = ((PyObject *)((PyObject *)Py_False));
3133  values[2] = ((PyObject *)((PyObject *)__pyx_int_1));
3134 
3135  /* "imate/traceinv/_hutchinson_method.pyx":41
3136  * gram=False,
3137  * p=1,
3138  * return_info=False, # <<<<<<<<<<<<<<
3139  * B=None,
3140  * C=None,
3141  */
3142  values[3] = ((PyObject *)((PyObject *)Py_False));
3143 
3144  /* "imate/traceinv/_hutchinson_method.pyx":42
3145  * p=1,
3146  * return_info=False,
3147  * B=None, # <<<<<<<<<<<<<<
3148  * C=None,
3149  * assume_matrix='gen',
3150  */
3151  values[4] = ((PyObject *)((PyObject *)Py_None));
3152 
3153  /* "imate/traceinv/_hutchinson_method.pyx":43
3154  * return_info=False,
3155  * B=None,
3156  * C=None, # <<<<<<<<<<<<<<
3157  * assume_matrix='gen',
3158  * min_num_samples=10,
3159  */
3160  values[5] = ((PyObject *)((PyObject *)Py_None));
3161  values[6] = ((PyObject *)((PyObject*)__pyx_n_u_gen));
3162  values[7] = ((PyObject *)((PyObject *)__pyx_int_10));
3163  values[8] = ((PyObject *)((PyObject *)__pyx_int_50));
3164 
3165  /* "imate/traceinv/_hutchinson_method.pyx":47
3166  * min_num_samples=10,
3167  * max_num_samples=50,
3168  * error_atol=None, # <<<<<<<<<<<<<<
3169  * error_rtol=1e-2,
3170  * confidence_level=0.95,
3171  */
3172  values[9] = ((PyObject *)((PyObject *)Py_None));
3173  values[10] = ((PyObject *)((PyObject*)__pyx_float_1eneg_2));
3174  values[11] = ((PyObject *)((PyObject*)__pyx_float_0_95));
3175  values[12] = ((PyObject *)((PyObject*)__pyx_float_0_001));
3176  values[13] = ((PyObject *)((PyObject*)__pyx_float_1eneg_6));
3177 
3178  /* "imate/traceinv/_hutchinson_method.pyx":52
3179  * outlier_significance_level=0.001,
3180  * solver_tol=1e-6,
3181  * orthogonalize=True, # <<<<<<<<<<<<<<
3182  * num_threads=0,
3183  * verbose=False,
3184  */
3185  values[14] = ((PyObject *)((PyObject *)Py_True));
3186  values[15] = ((PyObject *)((PyObject *)__pyx_int_0));
3187 
3188  /* "imate/traceinv/_hutchinson_method.pyx":54
3189  * orthogonalize=True,
3190  * num_threads=0,
3191  * verbose=False, # <<<<<<<<<<<<<<
3192  * plot=False):
3193  * """
3194  */
3195  values[16] = ((PyObject *)((PyObject *)Py_False));
3196 
3197  /* "imate/traceinv/_hutchinson_method.pyx":55
3198  * num_threads=0,
3199  * verbose=False,
3200  * plot=False): # <<<<<<<<<<<<<<
3201  * """
3202  * Trace of matrix or linear operator using stochastic Lanczos quadrature
3203  */
3204  values[17] = ((PyObject *)((PyObject *)Py_False));
3205  if (unlikely(__pyx_kwds)) {
3206  Py_ssize_t kw_args;
3207  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3208  switch (pos_args) {
3209  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3210  CYTHON_FALLTHROUGH;
3211  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3212  CYTHON_FALLTHROUGH;
3213  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3214  CYTHON_FALLTHROUGH;
3215  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3216  CYTHON_FALLTHROUGH;
3217  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3218  CYTHON_FALLTHROUGH;
3219  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3220  CYTHON_FALLTHROUGH;
3221  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3222  CYTHON_FALLTHROUGH;
3223  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3224  CYTHON_FALLTHROUGH;
3225  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3226  CYTHON_FALLTHROUGH;
3227  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3228  CYTHON_FALLTHROUGH;
3229  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3230  CYTHON_FALLTHROUGH;
3231  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3232  CYTHON_FALLTHROUGH;
3233  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3234  CYTHON_FALLTHROUGH;
3235  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3236  CYTHON_FALLTHROUGH;
3237  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3238  CYTHON_FALLTHROUGH;
3239  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3240  CYTHON_FALLTHROUGH;
3241  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3242  CYTHON_FALLTHROUGH;
3243  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3244  CYTHON_FALLTHROUGH;
3245  case 0: break;
3246  default: goto __pyx_L5_argtuple_error;
3247  }
3248  kw_args = PyDict_Size(__pyx_kwds);
3249  switch (pos_args) {
3250  case 0:
3251  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
3252  else goto __pyx_L5_argtuple_error;
3253  CYTHON_FALLTHROUGH;
3254  case 1:
3255  if (kw_args > 0) {
3256  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram);
3257  if (value) { values[1] = value; kw_args--; }
3258  }
3259  CYTHON_FALLTHROUGH;
3260  case 2:
3261  if (kw_args > 0) {
3262  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p);
3263  if (value) { values[2] = value; kw_args--; }
3264  }
3265  CYTHON_FALLTHROUGH;
3266  case 3:
3267  if (kw_args > 0) {
3268  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_return_info);
3269  if (value) { values[3] = value; kw_args--; }
3270  }
3271  CYTHON_FALLTHROUGH;
3272  case 4:
3273  if (kw_args > 0) {
3274  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B);
3275  if (value) { values[4] = value; kw_args--; }
3276  }
3277  CYTHON_FALLTHROUGH;
3278  case 5:
3279  if (kw_args > 0) {
3280  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C);
3281  if (value) { values[5] = value; kw_args--; }
3282  }
3283  CYTHON_FALLTHROUGH;
3284  case 6:
3285  if (kw_args > 0) {
3286  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix);
3287  if (value) { values[6] = value; kw_args--; }
3288  }
3289  CYTHON_FALLTHROUGH;
3290  case 7:
3291  if (kw_args > 0) {
3292  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples);
3293  if (value) { values[7] = value; kw_args--; }
3294  }
3295  CYTHON_FALLTHROUGH;
3296  case 8:
3297  if (kw_args > 0) {
3298  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples);
3299  if (value) { values[8] = value; kw_args--; }
3300  }
3301  CYTHON_FALLTHROUGH;
3302  case 9:
3303  if (kw_args > 0) {
3304  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol);
3305  if (value) { values[9] = value; kw_args--; }
3306  }
3307  CYTHON_FALLTHROUGH;
3308  case 10:
3309  if (kw_args > 0) {
3310  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol);
3311  if (value) { values[10] = value; kw_args--; }
3312  }
3313  CYTHON_FALLTHROUGH;
3314  case 11:
3315  if (kw_args > 0) {
3316  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level);
3317  if (value) { values[11] = value; kw_args--; }
3318  }
3319  CYTHON_FALLTHROUGH;
3320  case 12:
3321  if (kw_args > 0) {
3322  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level);
3323  if (value) { values[12] = value; kw_args--; }
3324  }
3325  CYTHON_FALLTHROUGH;
3326  case 13:
3327  if (kw_args > 0) {
3328  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol);
3329  if (value) { values[13] = value; kw_args--; }
3330  }
3331  CYTHON_FALLTHROUGH;
3332  case 14:
3333  if (kw_args > 0) {
3334  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orthogonalize);
3335  if (value) { values[14] = value; kw_args--; }
3336  }
3337  CYTHON_FALLTHROUGH;
3338  case 15:
3339  if (kw_args > 0) {
3340  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads);
3341  if (value) { values[15] = value; kw_args--; }
3342  }
3343  CYTHON_FALLTHROUGH;
3344  case 16:
3345  if (kw_args > 0) {
3346  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_verbose);
3347  if (value) { values[16] = value; kw_args--; }
3348  }
3349  CYTHON_FALLTHROUGH;
3350  case 17:
3351  if (kw_args > 0) {
3352  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_plot);
3353  if (value) { values[17] = value; kw_args--; }
3354  }
3355  }
3356  if (unlikely(kw_args > 0)) {
3357  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hutchinson_method") < 0)) __PYX_ERR(0, 37, __pyx_L3_error)
3358  }
3359  } else {
3360  switch (PyTuple_GET_SIZE(__pyx_args)) {
3361  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
3362  CYTHON_FALLTHROUGH;
3363  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
3364  CYTHON_FALLTHROUGH;
3365  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
3366  CYTHON_FALLTHROUGH;
3367  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
3368  CYTHON_FALLTHROUGH;
3369  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
3370  CYTHON_FALLTHROUGH;
3371  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
3372  CYTHON_FALLTHROUGH;
3373  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
3374  CYTHON_FALLTHROUGH;
3375  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
3376  CYTHON_FALLTHROUGH;
3377  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
3378  CYTHON_FALLTHROUGH;
3379  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
3380  CYTHON_FALLTHROUGH;
3381  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
3382  CYTHON_FALLTHROUGH;
3383  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3384  CYTHON_FALLTHROUGH;
3385  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3386  CYTHON_FALLTHROUGH;
3387  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3388  CYTHON_FALLTHROUGH;
3389  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3390  CYTHON_FALLTHROUGH;
3391  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3392  CYTHON_FALLTHROUGH;
3393  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3394  CYTHON_FALLTHROUGH;
3395  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3396  break;
3397  default: goto __pyx_L5_argtuple_error;
3398  }
3399  }
3400  __pyx_v_A = values[0];
3401  __pyx_v_gram = values[1];
3402  __pyx_v_p = values[2];
3403  __pyx_v_return_info = values[3];
3404  __pyx_v_B = values[4];
3405  __pyx_v_C = values[5];
3406  __pyx_v_assume_matrix = values[6];
3407  __pyx_v_min_num_samples = values[7];
3408  __pyx_v_max_num_samples = values[8];
3409  __pyx_v_error_atol = values[9];
3410  __pyx_v_error_rtol = values[10];
3411  __pyx_v_confidence_level = values[11];
3412  __pyx_v_outlier_significance_level = values[12];
3413  __pyx_v_solver_tol = values[13];
3414  __pyx_v_orthogonalize = values[14];
3415  __pyx_v_num_threads = values[15];
3416  __pyx_v_verbose = values[16];
3417  __pyx_v_plot = values[17];
3418  }
3419  goto __pyx_L4_argument_unpacking_done;
3420  __pyx_L5_argtuple_error:;
3421  __Pyx_RaiseArgtupleInvalid("hutchinson_method", 0, 1, 18, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 37, __pyx_L3_error)
3422  __pyx_L3_error:;
3423  __Pyx_AddTraceback("imate.traceinv._hutchinson_method.hutchinson_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
3424  __Pyx_RefNannyFinishContext();
3425  return NULL;
3426  __pyx_L4_argument_unpacking_done:;
3427  __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_hutchinson_method(__pyx_self, __pyx_v_A, __pyx_v_gram, __pyx_v_p, __pyx_v_return_info, __pyx_v_B, __pyx_v_C, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads, __pyx_v_verbose, __pyx_v_plot);
3428 
3429  /* "imate/traceinv/_hutchinson_method.pyx":37
3430  * # =================
3431  *
3432  * def hutchinson_method( # <<<<<<<<<<<<<<
3433  * A,
3434  * gram=False,
3435  */
3436 
3437  /* function exit code */
3438  __Pyx_RefNannyFinishContext();
3439  return __pyx_r;
3440 }
3441 
3442 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_hutchinson_method(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_return_info, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads, PyObject *__pyx_v_verbose, PyObject *__pyx_v_plot) {
3443  CYTHON_UNUSED PyObject *__pyx_v_square = NULL;
3444  PyObject *__pyx_v_data_type_name = NULL;
3445  PyObject *__pyx_v_trace = NULL;
3446  PyObject *__pyx_v_error = NULL;
3447  PyObject *__pyx_v_num_outliers = NULL;
3448  PyObject *__pyx_v_samples = NULL;
3449  PyObject *__pyx_v_processed_samples_indices = NULL;
3450  CYTHON_UNUSED PyObject *__pyx_v_num_processed_samples = NULL;
3451  PyObject *__pyx_v_num_samples_used = NULL;
3452  PyObject *__pyx_v_converged = NULL;
3453  PyObject *__pyx_v_tot_wall_time = NULL;
3454  PyObject *__pyx_v_alg_wall_time = NULL;
3455  PyObject *__pyx_v_cpu_proc_time = NULL;
3456  PyObject *__pyx_v_info = NULL;
3457  PyObject *__pyx_r = NULL;
3458  __Pyx_TraceDeclarations
3459  __Pyx_RefNannyDeclarations
3460  PyObject *__pyx_t_1 = NULL;
3461  PyObject *__pyx_t_2 = NULL;
3462  PyObject *__pyx_t_3 = NULL;
3463  int __pyx_t_4;
3464  PyObject *__pyx_t_5 = NULL;
3465  PyObject *__pyx_t_6 = NULL;
3466  PyObject *(*__pyx_t_7)(PyObject *);
3467  int __pyx_t_8;
3468  PyObject *__pyx_t_9 = NULL;
3469  PyObject *__pyx_t_10 = NULL;
3470  PyObject *__pyx_t_11 = NULL;
3471  PyObject *__pyx_t_12 = NULL;
3472  PyObject *__pyx_t_13 = NULL;
3473  PyObject *__pyx_t_14 = NULL;
3474  PyObject *__pyx_t_15 = NULL;
3475  PyObject *__pyx_t_16 = NULL;
3476  int __pyx_lineno = 0;
3477  const char *__pyx_filename = NULL;
3478  int __pyx_clineno = 0;
3479  __Pyx_TraceFrameInit(__pyx_codeobj_)
3480  __Pyx_RefNannySetupContext("hutchinson_method", 0);
3481  __Pyx_TraceCall("hutchinson_method", __pyx_f[0], 37, 0, __PYX_ERR(0, 37, __pyx_L1_error));
3482  __Pyx_INCREF(__pyx_v_min_num_samples);
3483  __Pyx_INCREF(__pyx_v_max_num_samples);
3484  __Pyx_INCREF(__pyx_v_error_atol);
3485  __Pyx_INCREF(__pyx_v_error_rtol);
3486  __Pyx_INCREF(__pyx_v_num_threads);
3487 
3488  /* "imate/traceinv/_hutchinson_method.pyx":602
3489  *
3490  * # Checking input arguments
3491  * error_atol, error_rtol, square = check_arguments( # <<<<<<<<<<<<<<
3492  * A, B, C, gram, p, return_info, assume_matrix, min_num_samples,
3493  * max_num_samples, error_atol, error_rtol, confidence_level,
3494  */
3495  __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
3496  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_check_arguments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
3497  __Pyx_GOTREF(__pyx_t_2);
3498 
3499  /* "imate/traceinv/_hutchinson_method.pyx":606
3500  * max_num_samples, error_atol, error_rtol, confidence_level,
3501  * outlier_significance_level, solver_tol, orthogonalize, num_threads,
3502  * verbose, plot) # <<<<<<<<<<<<<<
3503  *
3504  * # If the number of random vectors exceed the size of the vectors they
3505  */
3506  __Pyx_TraceLine(606,0,__PYX_ERR(0, 606, __pyx_L1_error))
3507  __pyx_t_3 = NULL;
3508  __pyx_t_4 = 0;
3509  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
3510  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3511  if (likely(__pyx_t_3)) {
3512  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3513  __Pyx_INCREF(__pyx_t_3);
3514  __Pyx_INCREF(function);
3515  __Pyx_DECREF_SET(__pyx_t_2, function);
3516  __pyx_t_4 = 1;
3517  }
3518  }
3519  #if CYTHON_FAST_PYCALL
3520  if (PyFunction_Check(__pyx_t_2)) {
3521  PyObject *__pyx_temp[19] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_return_info, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads, __pyx_v_verbose, __pyx_v_plot};
3522  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 18+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
3523  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3524  __Pyx_GOTREF(__pyx_t_1);
3525  } else
3526  #endif
3527  #if CYTHON_FAST_PYCCALL
3528  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
3529  PyObject *__pyx_temp[19] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_return_info, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads, __pyx_v_verbose, __pyx_v_plot};
3530  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 18+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
3531  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3532  __Pyx_GOTREF(__pyx_t_1);
3533  } else
3534  #endif
3535  {
3536  __pyx_t_5 = PyTuple_New(18+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error)
3537  __Pyx_GOTREF(__pyx_t_5);
3538  if (__pyx_t_3) {
3539  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
3540  }
3541  __Pyx_INCREF(__pyx_v_A);
3542  __Pyx_GIVEREF(__pyx_v_A);
3543  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_A);
3544  __Pyx_INCREF(__pyx_v_B);
3545  __Pyx_GIVEREF(__pyx_v_B);
3546  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_B);
3547  __Pyx_INCREF(__pyx_v_C);
3548  __Pyx_GIVEREF(__pyx_v_C);
3549  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_C);
3550  __Pyx_INCREF(__pyx_v_gram);
3551  __Pyx_GIVEREF(__pyx_v_gram);
3552  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_gram);
3553  __Pyx_INCREF(__pyx_v_p);
3554  __Pyx_GIVEREF(__pyx_v_p);
3555  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_v_p);
3556  __Pyx_INCREF(__pyx_v_return_info);
3557  __Pyx_GIVEREF(__pyx_v_return_info);
3558  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_return_info);
3559  __Pyx_INCREF(__pyx_v_assume_matrix);
3560  __Pyx_GIVEREF(__pyx_v_assume_matrix);
3561  PyTuple_SET_ITEM(__pyx_t_5, 6+__pyx_t_4, __pyx_v_assume_matrix);
3562  __Pyx_INCREF(__pyx_v_min_num_samples);
3563  __Pyx_GIVEREF(__pyx_v_min_num_samples);
3564  PyTuple_SET_ITEM(__pyx_t_5, 7+__pyx_t_4, __pyx_v_min_num_samples);
3565  __Pyx_INCREF(__pyx_v_max_num_samples);
3566  __Pyx_GIVEREF(__pyx_v_max_num_samples);
3567  PyTuple_SET_ITEM(__pyx_t_5, 8+__pyx_t_4, __pyx_v_max_num_samples);
3568  __Pyx_INCREF(__pyx_v_error_atol);
3569  __Pyx_GIVEREF(__pyx_v_error_atol);
3570  PyTuple_SET_ITEM(__pyx_t_5, 9+__pyx_t_4, __pyx_v_error_atol);
3571  __Pyx_INCREF(__pyx_v_error_rtol);
3572  __Pyx_GIVEREF(__pyx_v_error_rtol);
3573  PyTuple_SET_ITEM(__pyx_t_5, 10+__pyx_t_4, __pyx_v_error_rtol);
3574  __Pyx_INCREF(__pyx_v_confidence_level);
3575  __Pyx_GIVEREF(__pyx_v_confidence_level);
3576  PyTuple_SET_ITEM(__pyx_t_5, 11+__pyx_t_4, __pyx_v_confidence_level);
3577  __Pyx_INCREF(__pyx_v_outlier_significance_level);
3578  __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
3579  PyTuple_SET_ITEM(__pyx_t_5, 12+__pyx_t_4, __pyx_v_outlier_significance_level);
3580  __Pyx_INCREF(__pyx_v_solver_tol);
3581  __Pyx_GIVEREF(__pyx_v_solver_tol);
3582  PyTuple_SET_ITEM(__pyx_t_5, 13+__pyx_t_4, __pyx_v_solver_tol);
3583  __Pyx_INCREF(__pyx_v_orthogonalize);
3584  __Pyx_GIVEREF(__pyx_v_orthogonalize);
3585  PyTuple_SET_ITEM(__pyx_t_5, 14+__pyx_t_4, __pyx_v_orthogonalize);
3586  __Pyx_INCREF(__pyx_v_num_threads);
3587  __Pyx_GIVEREF(__pyx_v_num_threads);
3588  PyTuple_SET_ITEM(__pyx_t_5, 15+__pyx_t_4, __pyx_v_num_threads);
3589  __Pyx_INCREF(__pyx_v_verbose);
3590  __Pyx_GIVEREF(__pyx_v_verbose);
3591  PyTuple_SET_ITEM(__pyx_t_5, 16+__pyx_t_4, __pyx_v_verbose);
3592  __Pyx_INCREF(__pyx_v_plot);
3593  __Pyx_GIVEREF(__pyx_v_plot);
3594  PyTuple_SET_ITEM(__pyx_t_5, 17+__pyx_t_4, __pyx_v_plot);
3595  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
3596  __Pyx_GOTREF(__pyx_t_1);
3597  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3598  }
3599  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3600  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
3601  PyObject* sequence = __pyx_t_1;
3602  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3603  if (unlikely(size != 3)) {
3604  if (size > 3) __Pyx_RaiseTooManyValuesError(3);
3605  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3606  __PYX_ERR(0, 602, __pyx_L1_error)
3607  }
3608  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3609  if (likely(PyTuple_CheckExact(sequence))) {
3610  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
3611  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
3612  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
3613  } else {
3614  __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
3615  __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
3616  __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
3617  }
3618  __Pyx_INCREF(__pyx_t_2);
3619  __Pyx_INCREF(__pyx_t_5);
3620  __Pyx_INCREF(__pyx_t_3);
3621  #else
3622  __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
3623  __Pyx_GOTREF(__pyx_t_2);
3624  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error)
3625  __Pyx_GOTREF(__pyx_t_5);
3626  __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
3627  __Pyx_GOTREF(__pyx_t_3);
3628  #endif
3629  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3630  } else {
3631  Py_ssize_t index = -1;
3632  __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error)
3633  __Pyx_GOTREF(__pyx_t_6);
3634  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3635  __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
3636  index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
3637  __Pyx_GOTREF(__pyx_t_2);
3638  index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
3639  __Pyx_GOTREF(__pyx_t_5);
3640  index = 2; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
3641  __Pyx_GOTREF(__pyx_t_3);
3642  if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 3) < 0) __PYX_ERR(0, 602, __pyx_L1_error)
3643  __pyx_t_7 = NULL;
3644  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3645  goto __pyx_L4_unpacking_done;
3646  __pyx_L3_unpacking_failed:;
3647  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3648  __pyx_t_7 = NULL;
3649  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
3650  __PYX_ERR(0, 602, __pyx_L1_error)
3651  __pyx_L4_unpacking_done:;
3652  }
3653 
3654  /* "imate/traceinv/_hutchinson_method.pyx":602
3655  *
3656  * # Checking input arguments
3657  * error_atol, error_rtol, square = check_arguments( # <<<<<<<<<<<<<<
3658  * A, B, C, gram, p, return_info, assume_matrix, min_num_samples,
3659  * max_num_samples, error_atol, error_rtol, confidence_level,
3660  */
3661  __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
3662  __Pyx_DECREF_SET(__pyx_v_error_atol, __pyx_t_2);
3663  __pyx_t_2 = 0;
3664  __Pyx_DECREF_SET(__pyx_v_error_rtol, __pyx_t_5);
3665  __pyx_t_5 = 0;
3666  __pyx_v_square = __pyx_t_3;
3667  __pyx_t_3 = 0;
3668 
3669  /* "imate/traceinv/_hutchinson_method.pyx":611
3670  * # cannot be linearly independent and extra calculation with them will be
3671  * # redundant.
3672  * if A.shape[1] < max_num_samples: # <<<<<<<<<<<<<<
3673  * max_num_samples = A.shape[1]
3674  * if A.shape[1] < min_num_samples:
3675  */
3676  __Pyx_TraceLine(611,0,__PYX_ERR(0, 611, __pyx_L1_error))
3677  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
3678  __Pyx_GOTREF(__pyx_t_1);
3679  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
3680  __Pyx_GOTREF(__pyx_t_3);
3681  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3682  __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_max_num_samples, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
3683  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3684  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 611, __pyx_L1_error)
3685  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3686  if (__pyx_t_8) {
3687 
3688  /* "imate/traceinv/_hutchinson_method.pyx":612
3689  * # redundant.
3690  * if A.shape[1] < max_num_samples:
3691  * max_num_samples = A.shape[1] # <<<<<<<<<<<<<<
3692  * if A.shape[1] < min_num_samples:
3693  * min_num_samples = A.shape[1]
3694  */
3695  __Pyx_TraceLine(612,0,__PYX_ERR(0, 612, __pyx_L1_error))
3696  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
3697  __Pyx_GOTREF(__pyx_t_1);
3698  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
3699  __Pyx_GOTREF(__pyx_t_3);
3700  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3701  __Pyx_DECREF_SET(__pyx_v_max_num_samples, __pyx_t_3);
3702  __pyx_t_3 = 0;
3703 
3704  /* "imate/traceinv/_hutchinson_method.pyx":611
3705  * # cannot be linearly independent and extra calculation with them will be
3706  * # redundant.
3707  * if A.shape[1] < max_num_samples: # <<<<<<<<<<<<<<
3708  * max_num_samples = A.shape[1]
3709  * if A.shape[1] < min_num_samples:
3710  */
3711  }
3712 
3713  /* "imate/traceinv/_hutchinson_method.pyx":613
3714  * if A.shape[1] < max_num_samples:
3715  * max_num_samples = A.shape[1]
3716  * if A.shape[1] < min_num_samples: # <<<<<<<<<<<<<<
3717  * min_num_samples = A.shape[1]
3718  *
3719  */
3720  __Pyx_TraceLine(613,0,__PYX_ERR(0, 613, __pyx_L1_error))
3721  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
3722  __Pyx_GOTREF(__pyx_t_3);
3723  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
3724  __Pyx_GOTREF(__pyx_t_1);
3725  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3726  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_v_min_num_samples, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error)
3727  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3728  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 613, __pyx_L1_error)
3729  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3730  if (__pyx_t_8) {
3731 
3732  /* "imate/traceinv/_hutchinson_method.pyx":614
3733  * max_num_samples = A.shape[1]
3734  * if A.shape[1] < min_num_samples:
3735  * min_num_samples = A.shape[1] # <<<<<<<<<<<<<<
3736  *
3737  * # Parallel processing
3738  */
3739  __Pyx_TraceLine(614,0,__PYX_ERR(0, 614, __pyx_L1_error))
3740  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error)
3741  __Pyx_GOTREF(__pyx_t_3);
3742  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error)
3743  __Pyx_GOTREF(__pyx_t_1);
3744  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3745  __Pyx_DECREF_SET(__pyx_v_min_num_samples, __pyx_t_1);
3746  __pyx_t_1 = 0;
3747 
3748  /* "imate/traceinv/_hutchinson_method.pyx":613
3749  * if A.shape[1] < max_num_samples:
3750  * max_num_samples = A.shape[1]
3751  * if A.shape[1] < min_num_samples: # <<<<<<<<<<<<<<
3752  * min_num_samples = A.shape[1]
3753  *
3754  */
3755  }
3756 
3757  /* "imate/traceinv/_hutchinson_method.pyx":617
3758  *
3759  * # Parallel processing
3760  * if num_threads < 1: # <<<<<<<<<<<<<<
3761  * num_threads = multiprocessing.cpu_count()
3762  *
3763  */
3764  __Pyx_TraceLine(617,0,__PYX_ERR(0, 617, __pyx_L1_error))
3765  __pyx_t_1 = PyObject_RichCompare(__pyx_v_num_threads, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
3766  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
3767  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3768  if (__pyx_t_8) {
3769 
3770  /* "imate/traceinv/_hutchinson_method.pyx":618
3771  * # Parallel processing
3772  * if num_threads < 1:
3773  * num_threads = multiprocessing.cpu_count() # <<<<<<<<<<<<<<
3774  *
3775  * # Dispatch depending on 32-bit or 64-bit
3776  */
3777  __Pyx_TraceLine(618,0,__PYX_ERR(0, 618, __pyx_L1_error))
3778  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_multiprocessing); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
3779  __Pyx_GOTREF(__pyx_t_3);
3780  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cpu_count); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 618, __pyx_L1_error)
3781  __Pyx_GOTREF(__pyx_t_5);
3782  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3783  __pyx_t_3 = NULL;
3784  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3785  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
3786  if (likely(__pyx_t_3)) {
3787  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3788  __Pyx_INCREF(__pyx_t_3);
3789  __Pyx_INCREF(function);
3790  __Pyx_DECREF_SET(__pyx_t_5, function);
3791  }
3792  }
3793  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
3794  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3795  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
3796  __Pyx_GOTREF(__pyx_t_1);
3797  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3798  __Pyx_DECREF_SET(__pyx_v_num_threads, __pyx_t_1);
3799  __pyx_t_1 = 0;
3800 
3801  /* "imate/traceinv/_hutchinson_method.pyx":617
3802  *
3803  * # Parallel processing
3804  * if num_threads < 1: # <<<<<<<<<<<<<<
3805  * num_threads = multiprocessing.cpu_count()
3806  *
3807  */
3808  }
3809 
3810  /* "imate/traceinv/_hutchinson_method.pyx":621
3811  *
3812  * # Dispatch depending on 32-bit or 64-bit
3813  * data_type_name = get_data_type_name(A) # <<<<<<<<<<<<<<
3814  * if data_type_name == b'float32':
3815  * trace, error, num_outliers, samples, processed_samples_indices, \
3816  */
3817  __Pyx_TraceLine(621,0,__PYX_ERR(0, 621, __pyx_L1_error))
3818  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_data_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
3819  __Pyx_GOTREF(__pyx_t_5);
3820  __pyx_t_3 = NULL;
3821  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3822  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
3823  if (likely(__pyx_t_3)) {
3824  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3825  __Pyx_INCREF(__pyx_t_3);
3826  __Pyx_INCREF(function);
3827  __Pyx_DECREF_SET(__pyx_t_5, function);
3828  }
3829  }
3830  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_A);
3831  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3832  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
3833  __Pyx_GOTREF(__pyx_t_1);
3834  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3835  __pyx_v_data_type_name = __pyx_t_1;
3836  __pyx_t_1 = 0;
3837 
3838  /* "imate/traceinv/_hutchinson_method.pyx":622
3839  * # Dispatch depending on 32-bit or 64-bit
3840  * data_type_name = get_data_type_name(A)
3841  * if data_type_name == b'float32': # <<<<<<<<<<<<<<
3842  * trace, error, num_outliers, samples, processed_samples_indices, \
3843  * num_processed_samples, num_samples_used, converged, \
3844  */
3845  __Pyx_TraceLine(622,0,__PYX_ERR(0, 622, __pyx_L1_error))
3846  __pyx_t_8 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 622, __pyx_L1_error)
3847  if (__pyx_t_8) {
3848 
3849  /* "imate/traceinv/_hutchinson_method.pyx":626
3850  * num_processed_samples, num_samples_used, converged, \
3851  * tot_wall_time, alg_wall_time, cpu_proc_time = \
3852  * _hutchinson_method_float(A, B, C, gram, p, assume_matrix, # <<<<<<<<<<<<<<
3853  * min_num_samples, max_num_samples,
3854  * error_atol, error_rtol,
3855  */
3856  __Pyx_TraceLine(626,0,__PYX_ERR(0, 626, __pyx_L1_error))
3857  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_hutchinson_method_float); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 626, __pyx_L1_error)
3858  __Pyx_GOTREF(__pyx_t_5);
3859 
3860  /* "imate/traceinv/_hutchinson_method.pyx":632
3861  * outlier_significance_level,
3862  * solver_tol, orthogonalize,
3863  * num_threads) # <<<<<<<<<<<<<<
3864  *
3865  * elif data_type_name == b'float64':
3866  */
3867  __Pyx_TraceLine(632,0,__PYX_ERR(0, 632, __pyx_L1_error))
3868  __pyx_t_3 = NULL;
3869  __pyx_t_4 = 0;
3870  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3871  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
3872  if (likely(__pyx_t_3)) {
3873  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3874  __Pyx_INCREF(__pyx_t_3);
3875  __Pyx_INCREF(function);
3876  __Pyx_DECREF_SET(__pyx_t_5, function);
3877  __pyx_t_4 = 1;
3878  }
3879  }
3880  #if CYTHON_FAST_PYCALL
3881  if (PyFunction_Check(__pyx_t_5)) {
3882  PyObject *__pyx_temp[16] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
3883  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
3884  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3885  __Pyx_GOTREF(__pyx_t_1);
3886  } else
3887  #endif
3888  #if CYTHON_FAST_PYCCALL
3889  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3890  PyObject *__pyx_temp[16] = {__pyx_t_3, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
3891  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
3892  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3893  __Pyx_GOTREF(__pyx_t_1);
3894  } else
3895  #endif
3896  {
3897  __pyx_t_2 = PyTuple_New(15+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
3898  __Pyx_GOTREF(__pyx_t_2);
3899  if (__pyx_t_3) {
3900  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
3901  }
3902  __Pyx_INCREF(__pyx_v_A);
3903  __Pyx_GIVEREF(__pyx_v_A);
3904  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_v_A);
3905  __Pyx_INCREF(__pyx_v_B);
3906  __Pyx_GIVEREF(__pyx_v_B);
3907  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_v_B);
3908  __Pyx_INCREF(__pyx_v_C);
3909  __Pyx_GIVEREF(__pyx_v_C);
3910  PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_4, __pyx_v_C);
3911  __Pyx_INCREF(__pyx_v_gram);
3912  __Pyx_GIVEREF(__pyx_v_gram);
3913  PyTuple_SET_ITEM(__pyx_t_2, 3+__pyx_t_4, __pyx_v_gram);
3914  __Pyx_INCREF(__pyx_v_p);
3915  __Pyx_GIVEREF(__pyx_v_p);
3916  PyTuple_SET_ITEM(__pyx_t_2, 4+__pyx_t_4, __pyx_v_p);
3917  __Pyx_INCREF(__pyx_v_assume_matrix);
3918  __Pyx_GIVEREF(__pyx_v_assume_matrix);
3919  PyTuple_SET_ITEM(__pyx_t_2, 5+__pyx_t_4, __pyx_v_assume_matrix);
3920  __Pyx_INCREF(__pyx_v_min_num_samples);
3921  __Pyx_GIVEREF(__pyx_v_min_num_samples);
3922  PyTuple_SET_ITEM(__pyx_t_2, 6+__pyx_t_4, __pyx_v_min_num_samples);
3923  __Pyx_INCREF(__pyx_v_max_num_samples);
3924  __Pyx_GIVEREF(__pyx_v_max_num_samples);
3925  PyTuple_SET_ITEM(__pyx_t_2, 7+__pyx_t_4, __pyx_v_max_num_samples);
3926  __Pyx_INCREF(__pyx_v_error_atol);
3927  __Pyx_GIVEREF(__pyx_v_error_atol);
3928  PyTuple_SET_ITEM(__pyx_t_2, 8+__pyx_t_4, __pyx_v_error_atol);
3929  __Pyx_INCREF(__pyx_v_error_rtol);
3930  __Pyx_GIVEREF(__pyx_v_error_rtol);
3931  PyTuple_SET_ITEM(__pyx_t_2, 9+__pyx_t_4, __pyx_v_error_rtol);
3932  __Pyx_INCREF(__pyx_v_confidence_level);
3933  __Pyx_GIVEREF(__pyx_v_confidence_level);
3934  PyTuple_SET_ITEM(__pyx_t_2, 10+__pyx_t_4, __pyx_v_confidence_level);
3935  __Pyx_INCREF(__pyx_v_outlier_significance_level);
3936  __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
3937  PyTuple_SET_ITEM(__pyx_t_2, 11+__pyx_t_4, __pyx_v_outlier_significance_level);
3938  __Pyx_INCREF(__pyx_v_solver_tol);
3939  __Pyx_GIVEREF(__pyx_v_solver_tol);
3940  PyTuple_SET_ITEM(__pyx_t_2, 12+__pyx_t_4, __pyx_v_solver_tol);
3941  __Pyx_INCREF(__pyx_v_orthogonalize);
3942  __Pyx_GIVEREF(__pyx_v_orthogonalize);
3943  PyTuple_SET_ITEM(__pyx_t_2, 13+__pyx_t_4, __pyx_v_orthogonalize);
3944  __Pyx_INCREF(__pyx_v_num_threads);
3945  __Pyx_GIVEREF(__pyx_v_num_threads);
3946  PyTuple_SET_ITEM(__pyx_t_2, 14+__pyx_t_4, __pyx_v_num_threads);
3947  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
3948  __Pyx_GOTREF(__pyx_t_1);
3949  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3950  }
3951  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3952  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
3953  PyObject* sequence = __pyx_t_1;
3954  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3955  if (unlikely(size != 11)) {
3956  if (size > 11) __Pyx_RaiseTooManyValuesError(11);
3957  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3958  __PYX_ERR(0, 623, __pyx_L1_error)
3959  }
3960  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3961  if (likely(PyTuple_CheckExact(sequence))) {
3962  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
3963  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
3964  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
3965  __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
3966  __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4);
3967  __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5);
3968  __pyx_t_11 = PyTuple_GET_ITEM(sequence, 6);
3969  __pyx_t_12 = PyTuple_GET_ITEM(sequence, 7);
3970  __pyx_t_13 = PyTuple_GET_ITEM(sequence, 8);
3971  __pyx_t_14 = PyTuple_GET_ITEM(sequence, 9);
3972  __pyx_t_15 = PyTuple_GET_ITEM(sequence, 10);
3973  } else {
3974  __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
3975  __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
3976  __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
3977  __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
3978  __pyx_t_9 = PyList_GET_ITEM(sequence, 4);
3979  __pyx_t_10 = PyList_GET_ITEM(sequence, 5);
3980  __pyx_t_11 = PyList_GET_ITEM(sequence, 6);
3981  __pyx_t_12 = PyList_GET_ITEM(sequence, 7);
3982  __pyx_t_13 = PyList_GET_ITEM(sequence, 8);
3983  __pyx_t_14 = PyList_GET_ITEM(sequence, 9);
3984  __pyx_t_15 = PyList_GET_ITEM(sequence, 10);
3985  }
3986  __Pyx_INCREF(__pyx_t_5);
3987  __Pyx_INCREF(__pyx_t_2);
3988  __Pyx_INCREF(__pyx_t_3);
3989  __Pyx_INCREF(__pyx_t_6);
3990  __Pyx_INCREF(__pyx_t_9);
3991  __Pyx_INCREF(__pyx_t_10);
3992  __Pyx_INCREF(__pyx_t_11);
3993  __Pyx_INCREF(__pyx_t_12);
3994  __Pyx_INCREF(__pyx_t_13);
3995  __Pyx_INCREF(__pyx_t_14);
3996  __Pyx_INCREF(__pyx_t_15);
3997  #else
3998  {
3999  Py_ssize_t i;
4000  PyObject** temps[11] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_3,&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
4001  for (i=0; i < 11; i++) {
4002  PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 623, __pyx_L1_error)
4003  __Pyx_GOTREF(item);
4004  *(temps[i]) = item;
4005  }
4006  }
4007  #endif
4008  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4009  } else {
4010  Py_ssize_t index = -1;
4011  PyObject** temps[11] = {&__pyx_t_5,&__pyx_t_2,&__pyx_t_3,&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14,&__pyx_t_15};
4012  __pyx_t_16 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 623, __pyx_L1_error)
4013  __Pyx_GOTREF(__pyx_t_16);
4014  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4015  __pyx_t_7 = Py_TYPE(__pyx_t_16)->tp_iternext;
4016  for (index=0; index < 11; index++) {
4017  PyObject* item = __pyx_t_7(__pyx_t_16); if (unlikely(!item)) goto __pyx_L9_unpacking_failed;
4018  __Pyx_GOTREF(item);
4019  *(temps[index]) = item;
4020  }
4021  if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_16), 11) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
4022  __pyx_t_7 = NULL;
4023  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4024  goto __pyx_L10_unpacking_done;
4025  __pyx_L9_unpacking_failed:;
4026  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4027  __pyx_t_7 = NULL;
4028  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4029  __PYX_ERR(0, 623, __pyx_L1_error)
4030  __pyx_L10_unpacking_done:;
4031  }
4032 
4033  /* "imate/traceinv/_hutchinson_method.pyx":623
4034  * data_type_name = get_data_type_name(A)
4035  * if data_type_name == b'float32':
4036  * trace, error, num_outliers, samples, processed_samples_indices, \ # <<<<<<<<<<<<<<
4037  * num_processed_samples, num_samples_used, converged, \
4038  * tot_wall_time, alg_wall_time, cpu_proc_time = \
4039  */
4040  __Pyx_TraceLine(623,0,__PYX_ERR(0, 623, __pyx_L1_error))
4041  __pyx_v_trace = __pyx_t_5;
4042  __pyx_t_5 = 0;
4043  __pyx_v_error = __pyx_t_2;
4044  __pyx_t_2 = 0;
4045  __pyx_v_num_outliers = __pyx_t_3;
4046  __pyx_t_3 = 0;
4047  __pyx_v_samples = __pyx_t_6;
4048  __pyx_t_6 = 0;
4049  __pyx_v_processed_samples_indices = __pyx_t_9;
4050  __pyx_t_9 = 0;
4051  __pyx_v_num_processed_samples = __pyx_t_10;
4052  __pyx_t_10 = 0;
4053  __pyx_v_num_samples_used = __pyx_t_11;
4054  __pyx_t_11 = 0;
4055  __pyx_v_converged = __pyx_t_12;
4056  __pyx_t_12 = 0;
4057  __pyx_v_tot_wall_time = __pyx_t_13;
4058  __pyx_t_13 = 0;
4059  __pyx_v_alg_wall_time = __pyx_t_14;
4060  __pyx_t_14 = 0;
4061  __pyx_v_cpu_proc_time = __pyx_t_15;
4062  __pyx_t_15 = 0;
4063 
4064  /* "imate/traceinv/_hutchinson_method.pyx":622
4065  * # Dispatch depending on 32-bit or 64-bit
4066  * data_type_name = get_data_type_name(A)
4067  * if data_type_name == b'float32': # <<<<<<<<<<<<<<
4068  * trace, error, num_outliers, samples, processed_samples_indices, \
4069  * num_processed_samples, num_samples_used, converged, \
4070  */
4071  goto __pyx_L8;
4072  }
4073 
4074  /* "imate/traceinv/_hutchinson_method.pyx":634
4075  * num_threads)
4076  *
4077  * elif data_type_name == b'float64': # <<<<<<<<<<<<<<
4078  * trace, error, num_outliers, samples, processed_samples_indices, \
4079  * num_processed_samples, num_samples_used, converged, \
4080  */
4081  __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
4082  __pyx_t_8 = (__Pyx_PyBytes_Equals(__pyx_v_data_type_name, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
4083  if (likely(__pyx_t_8)) {
4084 
4085  /* "imate/traceinv/_hutchinson_method.pyx":638
4086  * num_processed_samples, num_samples_used, converged, \
4087  * tot_wall_time, alg_wall_time, cpu_proc_time = \
4088  * _hutchinson_method_double(A, B, C, gram, p, assume_matrix, # <<<<<<<<<<<<<<
4089  * min_num_samples, max_num_samples,
4090  * error_atol, error_rtol,
4091  */
4092  __Pyx_TraceLine(638,0,__PYX_ERR(0, 638, __pyx_L1_error))
4093  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_hutchinson_method_double); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 638, __pyx_L1_error)
4094  __Pyx_GOTREF(__pyx_t_15);
4095 
4096  /* "imate/traceinv/_hutchinson_method.pyx":644
4097  * outlier_significance_level,
4098  * solver_tol, orthogonalize,
4099  * num_threads) # <<<<<<<<<<<<<<
4100  * else:
4101  * raise TypeError('Data type should be either "float32" or "float64"')
4102  */
4103  __Pyx_TraceLine(644,0,__PYX_ERR(0, 644, __pyx_L1_error))
4104  __pyx_t_14 = NULL;
4105  __pyx_t_4 = 0;
4106  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
4107  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
4108  if (likely(__pyx_t_14)) {
4109  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
4110  __Pyx_INCREF(__pyx_t_14);
4111  __Pyx_INCREF(function);
4112  __Pyx_DECREF_SET(__pyx_t_15, function);
4113  __pyx_t_4 = 1;
4114  }
4115  }
4116  #if CYTHON_FAST_PYCALL
4117  if (PyFunction_Check(__pyx_t_15)) {
4118  PyObject *__pyx_temp[16] = {__pyx_t_14, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
4119  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
4120  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4121  __Pyx_GOTREF(__pyx_t_1);
4122  } else
4123  #endif
4124  #if CYTHON_FAST_PYCCALL
4125  if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
4126  PyObject *__pyx_temp[16] = {__pyx_t_14, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads};
4127  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_4, 15+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
4128  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
4129  __Pyx_GOTREF(__pyx_t_1);
4130  } else
4131  #endif
4132  {
4133  __pyx_t_13 = PyTuple_New(15+__pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 638, __pyx_L1_error)
4134  __Pyx_GOTREF(__pyx_t_13);
4135  if (__pyx_t_14) {
4136  __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __pyx_t_14 = NULL;
4137  }
4138  __Pyx_INCREF(__pyx_v_A);
4139  __Pyx_GIVEREF(__pyx_v_A);
4140  PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_4, __pyx_v_A);
4141  __Pyx_INCREF(__pyx_v_B);
4142  __Pyx_GIVEREF(__pyx_v_B);
4143  PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_4, __pyx_v_B);
4144  __Pyx_INCREF(__pyx_v_C);
4145  __Pyx_GIVEREF(__pyx_v_C);
4146  PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_4, __pyx_v_C);
4147  __Pyx_INCREF(__pyx_v_gram);
4148  __Pyx_GIVEREF(__pyx_v_gram);
4149  PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_4, __pyx_v_gram);
4150  __Pyx_INCREF(__pyx_v_p);
4151  __Pyx_GIVEREF(__pyx_v_p);
4152  PyTuple_SET_ITEM(__pyx_t_13, 4+__pyx_t_4, __pyx_v_p);
4153  __Pyx_INCREF(__pyx_v_assume_matrix);
4154  __Pyx_GIVEREF(__pyx_v_assume_matrix);
4155  PyTuple_SET_ITEM(__pyx_t_13, 5+__pyx_t_4, __pyx_v_assume_matrix);
4156  __Pyx_INCREF(__pyx_v_min_num_samples);
4157  __Pyx_GIVEREF(__pyx_v_min_num_samples);
4158  PyTuple_SET_ITEM(__pyx_t_13, 6+__pyx_t_4, __pyx_v_min_num_samples);
4159  __Pyx_INCREF(__pyx_v_max_num_samples);
4160  __Pyx_GIVEREF(__pyx_v_max_num_samples);
4161  PyTuple_SET_ITEM(__pyx_t_13, 7+__pyx_t_4, __pyx_v_max_num_samples);
4162  __Pyx_INCREF(__pyx_v_error_atol);
4163  __Pyx_GIVEREF(__pyx_v_error_atol);
4164  PyTuple_SET_ITEM(__pyx_t_13, 8+__pyx_t_4, __pyx_v_error_atol);
4165  __Pyx_INCREF(__pyx_v_error_rtol);
4166  __Pyx_GIVEREF(__pyx_v_error_rtol);
4167  PyTuple_SET_ITEM(__pyx_t_13, 9+__pyx_t_4, __pyx_v_error_rtol);
4168  __Pyx_INCREF(__pyx_v_confidence_level);
4169  __Pyx_GIVEREF(__pyx_v_confidence_level);
4170  PyTuple_SET_ITEM(__pyx_t_13, 10+__pyx_t_4, __pyx_v_confidence_level);
4171  __Pyx_INCREF(__pyx_v_outlier_significance_level);
4172  __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
4173  PyTuple_SET_ITEM(__pyx_t_13, 11+__pyx_t_4, __pyx_v_outlier_significance_level);
4174  __Pyx_INCREF(__pyx_v_solver_tol);
4175  __Pyx_GIVEREF(__pyx_v_solver_tol);
4176  PyTuple_SET_ITEM(__pyx_t_13, 12+__pyx_t_4, __pyx_v_solver_tol);
4177  __Pyx_INCREF(__pyx_v_orthogonalize);
4178  __Pyx_GIVEREF(__pyx_v_orthogonalize);
4179  PyTuple_SET_ITEM(__pyx_t_13, 13+__pyx_t_4, __pyx_v_orthogonalize);
4180  __Pyx_INCREF(__pyx_v_num_threads);
4181  __Pyx_GIVEREF(__pyx_v_num_threads);
4182  PyTuple_SET_ITEM(__pyx_t_13, 14+__pyx_t_4, __pyx_v_num_threads);
4183  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
4184  __Pyx_GOTREF(__pyx_t_1);
4185  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4186  }
4187  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4188  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
4189  PyObject* sequence = __pyx_t_1;
4190  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4191  if (unlikely(size != 11)) {
4192  if (size > 11) __Pyx_RaiseTooManyValuesError(11);
4193  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4194  __PYX_ERR(0, 635, __pyx_L1_error)
4195  }
4196  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4197  if (likely(PyTuple_CheckExact(sequence))) {
4198  __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0);
4199  __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
4200  __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2);
4201  __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3);
4202  __pyx_t_11 = PyTuple_GET_ITEM(sequence, 4);
4203  __pyx_t_10 = PyTuple_GET_ITEM(sequence, 5);
4204  __pyx_t_9 = PyTuple_GET_ITEM(sequence, 6);
4205  __pyx_t_6 = PyTuple_GET_ITEM(sequence, 7);
4206  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 8);
4207  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 9);
4208  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 10);
4209  } else {
4210  __pyx_t_15 = PyList_GET_ITEM(sequence, 0);
4211  __pyx_t_13 = PyList_GET_ITEM(sequence, 1);
4212  __pyx_t_14 = PyList_GET_ITEM(sequence, 2);
4213  __pyx_t_12 = PyList_GET_ITEM(sequence, 3);
4214  __pyx_t_11 = PyList_GET_ITEM(sequence, 4);
4215  __pyx_t_10 = PyList_GET_ITEM(sequence, 5);
4216  __pyx_t_9 = PyList_GET_ITEM(sequence, 6);
4217  __pyx_t_6 = PyList_GET_ITEM(sequence, 7);
4218  __pyx_t_3 = PyList_GET_ITEM(sequence, 8);
4219  __pyx_t_2 = PyList_GET_ITEM(sequence, 9);
4220  __pyx_t_5 = PyList_GET_ITEM(sequence, 10);
4221  }
4222  __Pyx_INCREF(__pyx_t_15);
4223  __Pyx_INCREF(__pyx_t_13);
4224  __Pyx_INCREF(__pyx_t_14);
4225  __Pyx_INCREF(__pyx_t_12);
4226  __Pyx_INCREF(__pyx_t_11);
4227  __Pyx_INCREF(__pyx_t_10);
4228  __Pyx_INCREF(__pyx_t_9);
4229  __Pyx_INCREF(__pyx_t_6);
4230  __Pyx_INCREF(__pyx_t_3);
4231  __Pyx_INCREF(__pyx_t_2);
4232  __Pyx_INCREF(__pyx_t_5);
4233  #else
4234  {
4235  Py_ssize_t i;
4236  PyObject** temps[11] = {&__pyx_t_15,&__pyx_t_13,&__pyx_t_14,&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9,&__pyx_t_6,&__pyx_t_3,&__pyx_t_2,&__pyx_t_5};
4237  for (i=0; i < 11; i++) {
4238  PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 635, __pyx_L1_error)
4239  __Pyx_GOTREF(item);
4240  *(temps[i]) = item;
4241  }
4242  }
4243  #endif
4244  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4245  } else {
4246  Py_ssize_t index = -1;
4247  PyObject** temps[11] = {&__pyx_t_15,&__pyx_t_13,&__pyx_t_14,&__pyx_t_12,&__pyx_t_11,&__pyx_t_10,&__pyx_t_9,&__pyx_t_6,&__pyx_t_3,&__pyx_t_2,&__pyx_t_5};
4248  __pyx_t_16 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 635, __pyx_L1_error)
4249  __Pyx_GOTREF(__pyx_t_16);
4250  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4251  __pyx_t_7 = Py_TYPE(__pyx_t_16)->tp_iternext;
4252  for (index=0; index < 11; index++) {
4253  PyObject* item = __pyx_t_7(__pyx_t_16); if (unlikely(!item)) goto __pyx_L11_unpacking_failed;
4254  __Pyx_GOTREF(item);
4255  *(temps[index]) = item;
4256  }
4257  if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_16), 11) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
4258  __pyx_t_7 = NULL;
4259  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4260  goto __pyx_L12_unpacking_done;
4261  __pyx_L11_unpacking_failed:;
4262  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4263  __pyx_t_7 = NULL;
4264  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4265  __PYX_ERR(0, 635, __pyx_L1_error)
4266  __pyx_L12_unpacking_done:;
4267  }
4268 
4269  /* "imate/traceinv/_hutchinson_method.pyx":635
4270  *
4271  * elif data_type_name == b'float64':
4272  * trace, error, num_outliers, samples, processed_samples_indices, \ # <<<<<<<<<<<<<<
4273  * num_processed_samples, num_samples_used, converged, \
4274  * tot_wall_time, alg_wall_time, cpu_proc_time = \
4275  */
4276  __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
4277  __pyx_v_trace = __pyx_t_15;
4278  __pyx_t_15 = 0;
4279  __pyx_v_error = __pyx_t_13;
4280  __pyx_t_13 = 0;
4281  __pyx_v_num_outliers = __pyx_t_14;
4282  __pyx_t_14 = 0;
4283  __pyx_v_samples = __pyx_t_12;
4284  __pyx_t_12 = 0;
4285  __pyx_v_processed_samples_indices = __pyx_t_11;
4286  __pyx_t_11 = 0;
4287  __pyx_v_num_processed_samples = __pyx_t_10;
4288  __pyx_t_10 = 0;
4289  __pyx_v_num_samples_used = __pyx_t_9;
4290  __pyx_t_9 = 0;
4291  __pyx_v_converged = __pyx_t_6;
4292  __pyx_t_6 = 0;
4293  __pyx_v_tot_wall_time = __pyx_t_3;
4294  __pyx_t_3 = 0;
4295  __pyx_v_alg_wall_time = __pyx_t_2;
4296  __pyx_t_2 = 0;
4297  __pyx_v_cpu_proc_time = __pyx_t_5;
4298  __pyx_t_5 = 0;
4299 
4300  /* "imate/traceinv/_hutchinson_method.pyx":634
4301  * num_threads)
4302  *
4303  * elif data_type_name == b'float64': # <<<<<<<<<<<<<<
4304  * trace, error, num_outliers, samples, processed_samples_indices, \
4305  * num_processed_samples, num_samples_used, converged, \
4306  */
4307  goto __pyx_L8;
4308  }
4309 
4310  /* "imate/traceinv/_hutchinson_method.pyx":646
4311  * num_threads)
4312  * else:
4313  * raise TypeError('Data type should be either "float32" or "float64"') # <<<<<<<<<<<<<<
4314  *
4315  * # Dictionary of output info
4316  */
4317  __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
4318  /*else*/ {
4319  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 646, __pyx_L1_error)
4320  __Pyx_GOTREF(__pyx_t_1);
4321  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4322  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4323  __PYX_ERR(0, 646, __pyx_L1_error)
4324  }
4325  __pyx_L8:;
4326 
4327  /* "imate/traceinv/_hutchinson_method.pyx":650
4328  * # Dictionary of output info
4329  * info = {
4330  * 'matrix': # <<<<<<<<<<<<<<
4331  * {
4332  * 'data_type': data_type_name,
4333  */
4334  __Pyx_TraceLine(650,0,__PYX_ERR(0, 650, __pyx_L1_error))
4335  __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
4336  __Pyx_GOTREF(__pyx_t_1);
4337 
4338  /* "imate/traceinv/_hutchinson_method.pyx":652
4339  * 'matrix':
4340  * {
4341  * 'data_type': data_type_name, # <<<<<<<<<<<<<<
4342  * 'gram': gram,
4343  * 'exponent': p,
4344  */
4345  __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
4346  __pyx_t_5 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error)
4347  __Pyx_GOTREF(__pyx_t_5);
4348  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_data_type, __pyx_v_data_type_name) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4349 
4350  /* "imate/traceinv/_hutchinson_method.pyx":653
4351  * {
4352  * 'data_type': data_type_name,
4353  * 'gram': gram, # <<<<<<<<<<<<<<
4354  * 'exponent': p,
4355  * 'assume_matrix': assume_matrix,
4356  */
4357  __Pyx_TraceLine(653,0,__PYX_ERR(0, 653, __pyx_L1_error))
4358  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_gram, __pyx_v_gram) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4359 
4360  /* "imate/traceinv/_hutchinson_method.pyx":654
4361  * 'data_type': data_type_name,
4362  * 'gram': gram,
4363  * 'exponent': p, # <<<<<<<<<<<<<<
4364  * 'assume_matrix': assume_matrix,
4365  * 'size': A.shape,
4366  */
4367  __Pyx_TraceLine(654,0,__PYX_ERR(0, 654, __pyx_L1_error))
4368  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_exponent, __pyx_v_p) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4369 
4370  /* "imate/traceinv/_hutchinson_method.pyx":655
4371  * 'gram': gram,
4372  * 'exponent': p,
4373  * 'assume_matrix': assume_matrix, # <<<<<<<<<<<<<<
4374  * 'size': A.shape,
4375  * 'sparse': isspmatrix(A),
4376  */
4377  __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
4378  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_assume_matrix, __pyx_v_assume_matrix) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4379 
4380  /* "imate/traceinv/_hutchinson_method.pyx":656
4381  * 'exponent': p,
4382  * 'assume_matrix': assume_matrix,
4383  * 'size': A.shape, # <<<<<<<<<<<<<<
4384  * 'sparse': isspmatrix(A),
4385  * 'nnz': get_nnz(A),
4386  */
4387  __Pyx_TraceLine(656,0,__PYX_ERR(0, 656, __pyx_L1_error))
4388  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
4389  __Pyx_GOTREF(__pyx_t_2);
4390  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_size, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4391  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4392 
4393  /* "imate/traceinv/_hutchinson_method.pyx":657
4394  * 'assume_matrix': assume_matrix,
4395  * 'size': A.shape,
4396  * 'sparse': isspmatrix(A), # <<<<<<<<<<<<<<
4397  * 'nnz': get_nnz(A),
4398  * 'density': get_density(A),
4399  */
4400  __Pyx_TraceLine(657,0,__PYX_ERR(0, 657, __pyx_L1_error))
4401  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error)
4402  __Pyx_GOTREF(__pyx_t_3);
4403  __pyx_t_6 = NULL;
4404  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4405  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4406  if (likely(__pyx_t_6)) {
4407  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4408  __Pyx_INCREF(__pyx_t_6);
4409  __Pyx_INCREF(function);
4410  __Pyx_DECREF_SET(__pyx_t_3, function);
4411  }
4412  }
4413  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4414  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4415  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 657, __pyx_L1_error)
4416  __Pyx_GOTREF(__pyx_t_2);
4417  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4418  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_sparse, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4419  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4420 
4421  /* "imate/traceinv/_hutchinson_method.pyx":658
4422  * 'size': A.shape,
4423  * 'sparse': isspmatrix(A),
4424  * 'nnz': get_nnz(A), # <<<<<<<<<<<<<<
4425  * 'density': get_density(A),
4426  * 'num_inquiries': 1
4427  */
4428  __Pyx_TraceLine(658,0,__PYX_ERR(0, 658, __pyx_L1_error))
4429  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
4430  __Pyx_GOTREF(__pyx_t_3);
4431  __pyx_t_6 = NULL;
4432  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4433  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4434  if (likely(__pyx_t_6)) {
4435  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4436  __Pyx_INCREF(__pyx_t_6);
4437  __Pyx_INCREF(function);
4438  __Pyx_DECREF_SET(__pyx_t_3, function);
4439  }
4440  }
4441  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4442  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4443  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
4444  __Pyx_GOTREF(__pyx_t_2);
4445  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4446  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_nnz, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4447  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4448 
4449  /* "imate/traceinv/_hutchinson_method.pyx":659
4450  * 'sparse': isspmatrix(A),
4451  * 'nnz': get_nnz(A),
4452  * 'density': get_density(A), # <<<<<<<<<<<<<<
4453  * 'num_inquiries': 1
4454  * },
4455  */
4456  __Pyx_TraceLine(659,0,__PYX_ERR(0, 659, __pyx_L1_error))
4457  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_get_density); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error)
4458  __Pyx_GOTREF(__pyx_t_3);
4459  __pyx_t_6 = NULL;
4460  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4461  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4462  if (likely(__pyx_t_6)) {
4463  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4464  __Pyx_INCREF(__pyx_t_6);
4465  __Pyx_INCREF(function);
4466  __Pyx_DECREF_SET(__pyx_t_3, function);
4467  }
4468  }
4469  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
4470  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4471  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 659, __pyx_L1_error)
4472  __Pyx_GOTREF(__pyx_t_2);
4473  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4474  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_density, __pyx_t_2) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4475  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4476  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_inquiries, __pyx_int_1) < 0) __PYX_ERR(0, 652, __pyx_L1_error)
4477  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_matrix, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4478  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4479 
4480  /* "imate/traceinv/_hutchinson_method.pyx":664
4481  * 'error':
4482  * {
4483  * 'absolute_error': error, # <<<<<<<<<<<<<<
4484  * 'relative_error': error / numpy.abs(trace),
4485  * 'error_atol': error_atol,
4486  */
4487  __Pyx_TraceLine(664,0,__PYX_ERR(0, 664, __pyx_L1_error))
4488  __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 664, __pyx_L1_error)
4489  __Pyx_GOTREF(__pyx_t_5);
4490  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_absolute_error, __pyx_v_error) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4491 
4492  /* "imate/traceinv/_hutchinson_method.pyx":665
4493  * {
4494  * 'absolute_error': error,
4495  * 'relative_error': error / numpy.abs(trace), # <<<<<<<<<<<<<<
4496  * 'error_atol': error_atol,
4497  * 'error_rtol': error_rtol,
4498  */
4499  __Pyx_TraceLine(665,0,__PYX_ERR(0, 665, __pyx_L1_error))
4500  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
4501  __Pyx_GOTREF(__pyx_t_3);
4502  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
4503  __Pyx_GOTREF(__pyx_t_6);
4504  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4505  __pyx_t_3 = NULL;
4506  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
4507  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
4508  if (likely(__pyx_t_3)) {
4509  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4510  __Pyx_INCREF(__pyx_t_3);
4511  __Pyx_INCREF(function);
4512  __Pyx_DECREF_SET(__pyx_t_6, function);
4513  }
4514  }
4515  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_trace) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_trace);
4516  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4517  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
4518  __Pyx_GOTREF(__pyx_t_2);
4519  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4520  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_error, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 665, __pyx_L1_error)
4521  __Pyx_GOTREF(__pyx_t_6);
4522  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4523  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_relative_error, __pyx_t_6) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4524  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4525 
4526  /* "imate/traceinv/_hutchinson_method.pyx":666
4527  * 'absolute_error': error,
4528  * 'relative_error': error / numpy.abs(trace),
4529  * 'error_atol': error_atol, # <<<<<<<<<<<<<<
4530  * 'error_rtol': error_rtol,
4531  * 'confidence_level': confidence_level,
4532  */
4533  __Pyx_TraceLine(666,0,__PYX_ERR(0, 666, __pyx_L1_error))
4534  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_error_atol, __pyx_v_error_atol) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4535 
4536  /* "imate/traceinv/_hutchinson_method.pyx":667
4537  * 'relative_error': error / numpy.abs(trace),
4538  * 'error_atol': error_atol,
4539  * 'error_rtol': error_rtol, # <<<<<<<<<<<<<<
4540  * 'confidence_level': confidence_level,
4541  * 'outlier_significance_level': outlier_significance_level
4542  */
4543  __Pyx_TraceLine(667,0,__PYX_ERR(0, 667, __pyx_L1_error))
4544  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_error_rtol, __pyx_v_error_rtol) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4545 
4546  /* "imate/traceinv/_hutchinson_method.pyx":668
4547  * 'error_atol': error_atol,
4548  * 'error_rtol': error_rtol,
4549  * 'confidence_level': confidence_level, # <<<<<<<<<<<<<<
4550  * 'outlier_significance_level': outlier_significance_level
4551  * },
4552  */
4553  __Pyx_TraceLine(668,0,__PYX_ERR(0, 668, __pyx_L1_error))
4554  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_confidence_level, __pyx_v_confidence_level) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4555 
4556  /* "imate/traceinv/_hutchinson_method.pyx":669
4557  * 'error_rtol': error_rtol,
4558  * 'confidence_level': confidence_level,
4559  * 'outlier_significance_level': outlier_significance_level # <<<<<<<<<<<<<<
4560  * },
4561  * 'convergence':
4562  */
4563  __Pyx_TraceLine(669,0,__PYX_ERR(0, 669, __pyx_L1_error))
4564  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_outlier_significance_level, __pyx_v_outlier_significance_level) < 0) __PYX_ERR(0, 664, __pyx_L1_error)
4565  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_error, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4566  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4567 
4568  /* "imate/traceinv/_hutchinson_method.pyx":673
4569  * 'convergence':
4570  * {
4571  * 'converged': bool(converged), # <<<<<<<<<<<<<<
4572  * 'min_num_samples': min_num_samples,
4573  * 'max_num_samples': max_num_samples,
4574  */
4575  __Pyx_TraceLine(673,0,__PYX_ERR(0, 673, __pyx_L1_error))
4576  __pyx_t_5 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 673, __pyx_L1_error)
4577  __Pyx_GOTREF(__pyx_t_5);
4578  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_converged); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 673, __pyx_L1_error)
4579  __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_8))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error)
4580  __Pyx_GOTREF(__pyx_t_6);
4581  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_converged, __pyx_t_6) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4582  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4583 
4584  /* "imate/traceinv/_hutchinson_method.pyx":674
4585  * {
4586  * 'converged': bool(converged),
4587  * 'min_num_samples': min_num_samples, # <<<<<<<<<<<<<<
4588  * 'max_num_samples': max_num_samples,
4589  * 'num_samples_used': num_samples_used,
4590  */
4591  __Pyx_TraceLine(674,0,__PYX_ERR(0, 674, __pyx_L1_error))
4592  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_min_num_samples, __pyx_v_min_num_samples) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4593 
4594  /* "imate/traceinv/_hutchinson_method.pyx":675
4595  * 'converged': bool(converged),
4596  * 'min_num_samples': min_num_samples,
4597  * 'max_num_samples': max_num_samples, # <<<<<<<<<<<<<<
4598  * 'num_samples_used': num_samples_used,
4599  * 'num_outliers': num_outliers,
4600  */
4601  __Pyx_TraceLine(675,0,__PYX_ERR(0, 675, __pyx_L1_error))
4602  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_max_num_samples, __pyx_v_max_num_samples) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4603 
4604  /* "imate/traceinv/_hutchinson_method.pyx":676
4605  * 'min_num_samples': min_num_samples,
4606  * 'max_num_samples': max_num_samples,
4607  * 'num_samples_used': num_samples_used, # <<<<<<<<<<<<<<
4608  * 'num_outliers': num_outliers,
4609  * 'samples': samples,
4610  */
4611  __Pyx_TraceLine(676,0,__PYX_ERR(0, 676, __pyx_L1_error))
4612  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_samples_used, __pyx_v_num_samples_used) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4613 
4614  /* "imate/traceinv/_hutchinson_method.pyx":677
4615  * 'max_num_samples': max_num_samples,
4616  * 'num_samples_used': num_samples_used,
4617  * 'num_outliers': num_outliers, # <<<<<<<<<<<<<<
4618  * 'samples': samples,
4619  * 'samples_mean': trace,
4620  */
4621  __Pyx_TraceLine(677,0,__PYX_ERR(0, 677, __pyx_L1_error))
4622  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_outliers, __pyx_v_num_outliers) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4623 
4624  /* "imate/traceinv/_hutchinson_method.pyx":678
4625  * 'num_samples_used': num_samples_used,
4626  * 'num_outliers': num_outliers,
4627  * 'samples': samples, # <<<<<<<<<<<<<<
4628  * 'samples_mean': trace,
4629  * 'samples_processed_order': processed_samples_indices
4630  */
4631  __Pyx_TraceLine(678,0,__PYX_ERR(0, 678, __pyx_L1_error))
4632  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_samples, __pyx_v_samples) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4633 
4634  /* "imate/traceinv/_hutchinson_method.pyx":679
4635  * 'num_outliers': num_outliers,
4636  * 'samples': samples,
4637  * 'samples_mean': trace, # <<<<<<<<<<<<<<
4638  * 'samples_processed_order': processed_samples_indices
4639  * },
4640  */
4641  __Pyx_TraceLine(679,0,__PYX_ERR(0, 679, __pyx_L1_error))
4642  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_samples_mean, __pyx_v_trace) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4643 
4644  /* "imate/traceinv/_hutchinson_method.pyx":680
4645  * 'samples': samples,
4646  * 'samples_mean': trace,
4647  * 'samples_processed_order': processed_samples_indices # <<<<<<<<<<<<<<
4648  * },
4649  * 'device':
4650  */
4651  __Pyx_TraceLine(680,0,__PYX_ERR(0, 680, __pyx_L1_error))
4652  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_samples_processed_order, __pyx_v_processed_samples_indices) < 0) __PYX_ERR(0, 673, __pyx_L1_error)
4653  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_convergence, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4654  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4655 
4656  /* "imate/traceinv/_hutchinson_method.pyx":684
4657  * 'device':
4658  * {
4659  * 'num_cpu_threads': num_threads, # <<<<<<<<<<<<<<
4660  * 'num_gpu_devices': 0,
4661  * 'num_gpu_multiprocessors': 0,
4662  */
4663  __Pyx_TraceLine(684,0,__PYX_ERR(0, 684, __pyx_L1_error))
4664  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L1_error)
4665  __Pyx_GOTREF(__pyx_t_5);
4666  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_cpu_threads, __pyx_v_num_threads) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4667  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_gpu_devices, __pyx_int_0) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4668  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_gpu_multiprocessors, __pyx_int_0) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4669  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_num_gpu_threads_per_multiprocess, __pyx_int_0) < 0) __PYX_ERR(0, 684, __pyx_L1_error)
4670  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_device, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4671  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4672 
4673  /* "imate/traceinv/_hutchinson_method.pyx":691
4674  * 'time':
4675  * {
4676  * 'tot_wall_time': tot_wall_time, # <<<<<<<<<<<<<<
4677  * 'alg_wall_time': alg_wall_time,
4678  * 'cpu_proc_time': cpu_proc_time,
4679  */
4680  __Pyx_TraceLine(691,0,__PYX_ERR(0, 691, __pyx_L1_error))
4681  __pyx_t_5 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 691, __pyx_L1_error)
4682  __Pyx_GOTREF(__pyx_t_5);
4683  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_tot_wall_time, __pyx_v_tot_wall_time) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
4684 
4685  /* "imate/traceinv/_hutchinson_method.pyx":692
4686  * {
4687  * 'tot_wall_time': tot_wall_time,
4688  * 'alg_wall_time': alg_wall_time, # <<<<<<<<<<<<<<
4689  * 'cpu_proc_time': cpu_proc_time,
4690  * },
4691  */
4692  __Pyx_TraceLine(692,0,__PYX_ERR(0, 692, __pyx_L1_error))
4693  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_alg_wall_time, __pyx_v_alg_wall_time) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
4694 
4695  /* "imate/traceinv/_hutchinson_method.pyx":693
4696  * 'tot_wall_time': tot_wall_time,
4697  * 'alg_wall_time': alg_wall_time,
4698  * 'cpu_proc_time': cpu_proc_time, # <<<<<<<<<<<<<<
4699  * },
4700  * 'solver':
4701  */
4702  __Pyx_TraceLine(693,0,__PYX_ERR(0, 693, __pyx_L1_error))
4703  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_cpu_proc_time, __pyx_v_cpu_proc_time) < 0) __PYX_ERR(0, 691, __pyx_L1_error)
4704  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_time, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4705  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4706 
4707  /* "imate/traceinv/_hutchinson_method.pyx":697
4708  * 'solver':
4709  * {
4710  * 'version': __version__, # <<<<<<<<<<<<<<
4711  * 'orthogonalize': orthogonalize,
4712  * 'solver_tol': solver_tol,
4713  */
4714  __Pyx_TraceLine(697,0,__PYX_ERR(0, 697, __pyx_L1_error))
4715  __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
4716  __Pyx_GOTREF(__pyx_t_5);
4717  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_version_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 697, __pyx_L1_error)
4718  __Pyx_GOTREF(__pyx_t_6);
4719  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_version, __pyx_t_6) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4720  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4721 
4722  /* "imate/traceinv/_hutchinson_method.pyx":698
4723  * {
4724  * 'version': __version__,
4725  * 'orthogonalize': orthogonalize, # <<<<<<<<<<<<<<
4726  * 'solver_tol': solver_tol,
4727  * 'method': 'hutchinson',
4728  */
4729  __Pyx_TraceLine(698,0,__PYX_ERR(0, 698, __pyx_L1_error))
4730  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_orthogonalize, __pyx_v_orthogonalize) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4731 
4732  /* "imate/traceinv/_hutchinson_method.pyx":699
4733  * 'version': __version__,
4734  * 'orthogonalize': orthogonalize,
4735  * 'solver_tol': solver_tol, # <<<<<<<<<<<<<<
4736  * 'method': 'hutchinson',
4737  * }
4738  */
4739  __Pyx_TraceLine(699,0,__PYX_ERR(0, 699, __pyx_L1_error))
4740  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_solver_tol, __pyx_v_solver_tol) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4741  if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_method, __pyx_n_u_hutchinson) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
4742  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_solver, __pyx_t_5) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
4743  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4744  __pyx_v_info = ((PyObject*)__pyx_t_1);
4745  __pyx_t_1 = 0;
4746 
4747  /* "imate/traceinv/_hutchinson_method.pyx":705
4748  *
4749  * # print summary
4750  * if verbose: # <<<<<<<<<<<<<<
4751  * print_summary(info)
4752  *
4753  */
4754  __Pyx_TraceLine(705,0,__PYX_ERR(0, 705, __pyx_L1_error))
4755  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 705, __pyx_L1_error)
4756  if (__pyx_t_8) {
4757 
4758  /* "imate/traceinv/_hutchinson_method.pyx":706
4759  * # print summary
4760  * if verbose:
4761  * print_summary(info) # <<<<<<<<<<<<<<
4762  *
4763  * # Plot results
4764  */
4765  __Pyx_TraceLine(706,0,__PYX_ERR(0, 706, __pyx_L1_error))
4766  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_print_summary); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 706, __pyx_L1_error)
4767  __Pyx_GOTREF(__pyx_t_5);
4768  __pyx_t_6 = NULL;
4769  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4770  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4771  if (likely(__pyx_t_6)) {
4772  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4773  __Pyx_INCREF(__pyx_t_6);
4774  __Pyx_INCREF(function);
4775  __Pyx_DECREF_SET(__pyx_t_5, function);
4776  }
4777  }
4778  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_info) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_info);
4779  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4780  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
4781  __Pyx_GOTREF(__pyx_t_1);
4782  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4783  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4784 
4785  /* "imate/traceinv/_hutchinson_method.pyx":705
4786  *
4787  * # print summary
4788  * if verbose: # <<<<<<<<<<<<<<
4789  * print_summary(info)
4790  *
4791  */
4792  }
4793 
4794  /* "imate/traceinv/_hutchinson_method.pyx":709
4795  *
4796  * # Plot results
4797  * if plot: # <<<<<<<<<<<<<<
4798  * plot_convergence(info)
4799  *
4800  */
4801  __Pyx_TraceLine(709,0,__PYX_ERR(0, 709, __pyx_L1_error))
4802  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_plot); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
4803  if (__pyx_t_8) {
4804 
4805  /* "imate/traceinv/_hutchinson_method.pyx":710
4806  * # Plot results
4807  * if plot:
4808  * plot_convergence(info) # <<<<<<<<<<<<<<
4809  *
4810  * if return_info:
4811  */
4812  __Pyx_TraceLine(710,0,__PYX_ERR(0, 710, __pyx_L1_error))
4813  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_plot_convergence); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error)
4814  __Pyx_GOTREF(__pyx_t_5);
4815  __pyx_t_6 = NULL;
4816  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4817  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4818  if (likely(__pyx_t_6)) {
4819  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4820  __Pyx_INCREF(__pyx_t_6);
4821  __Pyx_INCREF(function);
4822  __Pyx_DECREF_SET(__pyx_t_5, function);
4823  }
4824  }
4825  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_info) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_info);
4826  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4827  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
4828  __Pyx_GOTREF(__pyx_t_1);
4829  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4830  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4831 
4832  /* "imate/traceinv/_hutchinson_method.pyx":709
4833  *
4834  * # Plot results
4835  * if plot: # <<<<<<<<<<<<<<
4836  * plot_convergence(info)
4837  *
4838  */
4839  }
4840 
4841  /* "imate/traceinv/_hutchinson_method.pyx":712
4842  * plot_convergence(info)
4843  *
4844  * if return_info: # <<<<<<<<<<<<<<
4845  * return trace, info
4846  * else:
4847  */
4848  __Pyx_TraceLine(712,0,__PYX_ERR(0, 712, __pyx_L1_error))
4849  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_return_info); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 712, __pyx_L1_error)
4850  if (__pyx_t_8) {
4851 
4852  /* "imate/traceinv/_hutchinson_method.pyx":713
4853  *
4854  * if return_info:
4855  * return trace, info # <<<<<<<<<<<<<<
4856  * else:
4857  * return trace
4858  */
4859  __Pyx_TraceLine(713,0,__PYX_ERR(0, 713, __pyx_L1_error))
4860  __Pyx_XDECREF(__pyx_r);
4861  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error)
4862  __Pyx_GOTREF(__pyx_t_1);
4863  __Pyx_INCREF(__pyx_v_trace);
4864  __Pyx_GIVEREF(__pyx_v_trace);
4865  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_trace);
4866  __Pyx_INCREF(__pyx_v_info);
4867  __Pyx_GIVEREF(__pyx_v_info);
4868  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_info);
4869  __pyx_r = __pyx_t_1;
4870  __pyx_t_1 = 0;
4871  goto __pyx_L0;
4872 
4873  /* "imate/traceinv/_hutchinson_method.pyx":712
4874  * plot_convergence(info)
4875  *
4876  * if return_info: # <<<<<<<<<<<<<<
4877  * return trace, info
4878  * else:
4879  */
4880  }
4881 
4882  /* "imate/traceinv/_hutchinson_method.pyx":715
4883  * return trace, info
4884  * else:
4885  * return trace # <<<<<<<<<<<<<<
4886  *
4887  *
4888  */
4889  __Pyx_TraceLine(715,0,__PYX_ERR(0, 715, __pyx_L1_error))
4890  /*else*/ {
4891  __Pyx_XDECREF(__pyx_r);
4892  __Pyx_INCREF(__pyx_v_trace);
4893  __pyx_r = __pyx_v_trace;
4894  goto __pyx_L0;
4895  }
4896 
4897  /* "imate/traceinv/_hutchinson_method.pyx":37
4898  * # =================
4899  *
4900  * def hutchinson_method( # <<<<<<<<<<<<<<
4901  * A,
4902  * gram=False,
4903  */
4904 
4905  /* function exit code */
4906  __pyx_L1_error:;
4907  __Pyx_XDECREF(__pyx_t_1);
4908  __Pyx_XDECREF(__pyx_t_2);
4909  __Pyx_XDECREF(__pyx_t_3);
4910  __Pyx_XDECREF(__pyx_t_5);
4911  __Pyx_XDECREF(__pyx_t_6);
4912  __Pyx_XDECREF(__pyx_t_9);
4913  __Pyx_XDECREF(__pyx_t_10);
4914  __Pyx_XDECREF(__pyx_t_11);
4915  __Pyx_XDECREF(__pyx_t_12);
4916  __Pyx_XDECREF(__pyx_t_13);
4917  __Pyx_XDECREF(__pyx_t_14);
4918  __Pyx_XDECREF(__pyx_t_15);
4919  __Pyx_XDECREF(__pyx_t_16);
4920  __Pyx_AddTraceback("imate.traceinv._hutchinson_method.hutchinson_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
4921  __pyx_r = NULL;
4922  __pyx_L0:;
4923  __Pyx_XDECREF(__pyx_v_square);
4924  __Pyx_XDECREF(__pyx_v_data_type_name);
4925  __Pyx_XDECREF(__pyx_v_trace);
4926  __Pyx_XDECREF(__pyx_v_error);
4927  __Pyx_XDECREF(__pyx_v_num_outliers);
4928  __Pyx_XDECREF(__pyx_v_samples);
4929  __Pyx_XDECREF(__pyx_v_processed_samples_indices);
4930  __Pyx_XDECREF(__pyx_v_num_processed_samples);
4931  __Pyx_XDECREF(__pyx_v_num_samples_used);
4932  __Pyx_XDECREF(__pyx_v_converged);
4933  __Pyx_XDECREF(__pyx_v_tot_wall_time);
4934  __Pyx_XDECREF(__pyx_v_alg_wall_time);
4935  __Pyx_XDECREF(__pyx_v_cpu_proc_time);
4936  __Pyx_XDECREF(__pyx_v_info);
4937  __Pyx_XDECREF(__pyx_v_min_num_samples);
4938  __Pyx_XDECREF(__pyx_v_max_num_samples);
4939  __Pyx_XDECREF(__pyx_v_error_atol);
4940  __Pyx_XDECREF(__pyx_v_error_rtol);
4941  __Pyx_XDECREF(__pyx_v_num_threads);
4942  __Pyx_XGIVEREF(__pyx_r);
4943  __Pyx_TraceReturn(__pyx_r, 0);
4944  __Pyx_RefNannyFinishContext();
4945  return __pyx_r;
4946 }
4947 
4948 /* "imate/traceinv/_hutchinson_method.pyx":722
4949  * # =======================
4950  *
4951  * def _hutchinson_method_float( # <<<<<<<<<<<<<<
4952  * A,
4953  * B,
4954  */
4955 
4956 /* Python wrapper */
4957 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4958 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float[] = "_hutchinson_method_float(A, B, C, gram, p, assume_matrix, min_num_samples, max_num_samples, error_atol, error_rtol, confidence_level, outlier_significance_level, solver_tol, orthogonalize, num_threads)\n\n This method processes single precision (32-bit) matrix ``A``.\n ";
4959 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float = {"_hutchinson_method_float", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float};
4960 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4961  PyObject *__pyx_v_A = 0;
4962  PyObject *__pyx_v_B = 0;
4963  PyObject *__pyx_v_C = 0;
4964  PyObject *__pyx_v_gram = 0;
4965  PyObject *__pyx_v_p = 0;
4966  PyObject *__pyx_v_assume_matrix = 0;
4967  PyObject *__pyx_v_min_num_samples = 0;
4968  PyObject *__pyx_v_max_num_samples = 0;
4969  PyObject *__pyx_v_error_atol = 0;
4970  PyObject *__pyx_v_error_rtol = 0;
4971  PyObject *__pyx_v_confidence_level = 0;
4972  PyObject *__pyx_v_outlier_significance_level = 0;
4973  PyObject *__pyx_v_solver_tol = 0;
4974  PyObject *__pyx_v_orthogonalize = 0;
4975  PyObject *__pyx_v_num_threads = 0;
4976  int __pyx_lineno = 0;
4977  const char *__pyx_filename = NULL;
4978  int __pyx_clineno = 0;
4979  PyObject *__pyx_r = 0;
4980  __Pyx_RefNannyDeclarations
4981  __Pyx_RefNannySetupContext("_hutchinson_method_float (wrapper)", 0);
4982  {
4983  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_gram,&__pyx_n_s_p,&__pyx_n_s_assume_matrix,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_solver_tol,&__pyx_n_s_orthogonalize,&__pyx_n_s_num_threads,0};
4984  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
4985  if (unlikely(__pyx_kwds)) {
4986  Py_ssize_t kw_args;
4987  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4988  switch (pos_args) {
4989  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
4990  CYTHON_FALLTHROUGH;
4991  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
4992  CYTHON_FALLTHROUGH;
4993  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
4994  CYTHON_FALLTHROUGH;
4995  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
4996  CYTHON_FALLTHROUGH;
4997  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
4998  CYTHON_FALLTHROUGH;
4999  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5000  CYTHON_FALLTHROUGH;
5001  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5002  CYTHON_FALLTHROUGH;
5003  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5004  CYTHON_FALLTHROUGH;
5005  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5006  CYTHON_FALLTHROUGH;
5007  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5008  CYTHON_FALLTHROUGH;
5009  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5010  CYTHON_FALLTHROUGH;
5011  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5012  CYTHON_FALLTHROUGH;
5013  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5014  CYTHON_FALLTHROUGH;
5015  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5016  CYTHON_FALLTHROUGH;
5017  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5018  CYTHON_FALLTHROUGH;
5019  case 0: break;
5020  default: goto __pyx_L5_argtuple_error;
5021  }
5022  kw_args = PyDict_Size(__pyx_kwds);
5023  switch (pos_args) {
5024  case 0:
5025  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
5026  else goto __pyx_L5_argtuple_error;
5027  CYTHON_FALLTHROUGH;
5028  case 1:
5029  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
5030  else {
5031  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 1); __PYX_ERR(0, 722, __pyx_L3_error)
5032  }
5033  CYTHON_FALLTHROUGH;
5034  case 2:
5035  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
5036  else {
5037  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 2); __PYX_ERR(0, 722, __pyx_L3_error)
5038  }
5039  CYTHON_FALLTHROUGH;
5040  case 3:
5041  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram)) != 0)) kw_args--;
5042  else {
5043  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 3); __PYX_ERR(0, 722, __pyx_L3_error)
5044  }
5045  CYTHON_FALLTHROUGH;
5046  case 4:
5047  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
5048  else {
5049  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 4); __PYX_ERR(0, 722, __pyx_L3_error)
5050  }
5051  CYTHON_FALLTHROUGH;
5052  case 5:
5053  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix)) != 0)) kw_args--;
5054  else {
5055  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 5); __PYX_ERR(0, 722, __pyx_L3_error)
5056  }
5057  CYTHON_FALLTHROUGH;
5058  case 6:
5059  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples)) != 0)) kw_args--;
5060  else {
5061  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 6); __PYX_ERR(0, 722, __pyx_L3_error)
5062  }
5063  CYTHON_FALLTHROUGH;
5064  case 7:
5065  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples)) != 0)) kw_args--;
5066  else {
5067  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 7); __PYX_ERR(0, 722, __pyx_L3_error)
5068  }
5069  CYTHON_FALLTHROUGH;
5070  case 8:
5071  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol)) != 0)) kw_args--;
5072  else {
5073  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 8); __PYX_ERR(0, 722, __pyx_L3_error)
5074  }
5075  CYTHON_FALLTHROUGH;
5076  case 9:
5077  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol)) != 0)) kw_args--;
5078  else {
5079  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 9); __PYX_ERR(0, 722, __pyx_L3_error)
5080  }
5081  CYTHON_FALLTHROUGH;
5082  case 10:
5083  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level)) != 0)) kw_args--;
5084  else {
5085  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 10); __PYX_ERR(0, 722, __pyx_L3_error)
5086  }
5087  CYTHON_FALLTHROUGH;
5088  case 11:
5089  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level)) != 0)) kw_args--;
5090  else {
5091  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 11); __PYX_ERR(0, 722, __pyx_L3_error)
5092  }
5093  CYTHON_FALLTHROUGH;
5094  case 12:
5095  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol)) != 0)) kw_args--;
5096  else {
5097  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 12); __PYX_ERR(0, 722, __pyx_L3_error)
5098  }
5099  CYTHON_FALLTHROUGH;
5100  case 13:
5101  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orthogonalize)) != 0)) kw_args--;
5102  else {
5103  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 13); __PYX_ERR(0, 722, __pyx_L3_error)
5104  }
5105  CYTHON_FALLTHROUGH;
5106  case 14:
5107  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--;
5108  else {
5109  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, 14); __PYX_ERR(0, 722, __pyx_L3_error)
5110  }
5111  }
5112  if (unlikely(kw_args > 0)) {
5113  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_hutchinson_method_float") < 0)) __PYX_ERR(0, 722, __pyx_L3_error)
5114  }
5115  } else if (PyTuple_GET_SIZE(__pyx_args) != 15) {
5116  goto __pyx_L5_argtuple_error;
5117  } else {
5118  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5119  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5120  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5121  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5122  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5123  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5124  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5125  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5126  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
5127  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
5128  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
5129  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
5130  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
5131  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
5132  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
5133  }
5134  __pyx_v_A = values[0];
5135  __pyx_v_B = values[1];
5136  __pyx_v_C = values[2];
5137  __pyx_v_gram = values[3];
5138  __pyx_v_p = values[4];
5139  __pyx_v_assume_matrix = values[5];
5140  __pyx_v_min_num_samples = values[6];
5141  __pyx_v_max_num_samples = values[7];
5142  __pyx_v_error_atol = values[8];
5143  __pyx_v_error_rtol = values[9];
5144  __pyx_v_confidence_level = values[10];
5145  __pyx_v_outlier_significance_level = values[11];
5146  __pyx_v_solver_tol = values[12];
5147  __pyx_v_orthogonalize = values[13];
5148  __pyx_v_num_threads = values[14];
5149  }
5150  goto __pyx_L4_argument_unpacking_done;
5151  __pyx_L5_argtuple_error:;
5152  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_float", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 722, __pyx_L3_error)
5153  __pyx_L3_error:;
5154  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._hutchinson_method_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5155  __Pyx_RefNannyFinishContext();
5156  return NULL;
5157  __pyx_L4_argument_unpacking_done:;
5158  __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float(__pyx_self, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads);
5159 
5160  /* function exit code */
5161  __Pyx_RefNannyFinishContext();
5162  return __pyx_r;
5163 }
5164 
5165 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_2_hutchinson_method_float(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads) {
5166  PyObject *__pyx_v_vector_size = NULL;
5167  PyObject *__pyx_v_E = NULL;
5168  __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
5169  float *__pyx_v_cE;
5170  PyObject *__pyx_v_init_tot_wall_time = NULL;
5171  PyObject *__pyx_v_init_cpu_proc_time = NULL;
5172  PyObject *__pyx_v_samples = NULL;
5173  PyObject *__pyx_v_processed_samples_indices = NULL;
5174  int __pyx_v_num_processed_samples;
5175  int __pyx_v_num_samples_used;
5176  int __pyx_v_converged;
5177  PyObject *__pyx_v_init_alg_wall_time = NULL;
5178  PyObject *__pyx_v_AtA = NULL;
5179  PyObject *__pyx_v_i = NULL;
5180  PyObject *__pyx_v_alg_wall_time = NULL;
5181  PyObject *__pyx_v_trace = NULL;
5182  PyObject *__pyx_v_error = NULL;
5183  PyObject *__pyx_v_num_outliers = NULL;
5184  PyObject *__pyx_v_tot_wall_time = NULL;
5185  PyObject *__pyx_v_cpu_proc_time = NULL;
5186  PyObject *__pyx_r = NULL;
5187  __Pyx_TraceDeclarations
5188  __Pyx_RefNannyDeclarations
5189  PyObject *__pyx_t_1 = NULL;
5190  PyObject *__pyx_t_2 = NULL;
5191  PyObject *__pyx_t_3 = NULL;
5192  PyObject *__pyx_t_4 = NULL;
5193  PyObject *__pyx_t_5 = NULL;
5194  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5195  Py_ssize_t __pyx_t_7;
5196  Py_ssize_t __pyx_t_8;
5197  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_9;
5198  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
5199  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
5200  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
5201  int __pyx_t_13;
5202  int __pyx_t_14;
5203  int __pyx_t_15;
5204  Py_ssize_t __pyx_t_16;
5205  PyObject *(*__pyx_t_17)(PyObject *);
5206  float __pyx_t_18;
5207  int __pyx_t_19;
5208  PyObject *__pyx_t_20 = NULL;
5209  PyObject *(*__pyx_t_21)(PyObject *);
5210  int __pyx_t_22;
5211  int __pyx_lineno = 0;
5212  const char *__pyx_filename = NULL;
5213  int __pyx_clineno = 0;
5214  __Pyx_TraceFrameInit(__pyx_codeobj__3)
5215  __Pyx_RefNannySetupContext("_hutchinson_method_float", 0);
5216  __Pyx_TraceCall("_hutchinson_method_float", __pyx_f[0], 722, 0, __PYX_ERR(0, 722, __pyx_L1_error));
5217 
5218  /* "imate/traceinv/_hutchinson_method.pyx":742
5219  * """
5220  *
5221  * vector_size = A.shape[0] # <<<<<<<<<<<<<<
5222  *
5223  * # Allocate random array with Fortran ordering (first index is contiguous)
5224  */
5225  __Pyx_TraceLine(742,0,__PYX_ERR(0, 742, __pyx_L1_error))
5226  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
5227  __Pyx_GOTREF(__pyx_t_1);
5228  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
5229  __Pyx_GOTREF(__pyx_t_2);
5230  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5231  __pyx_v_vector_size = __pyx_t_2;
5232  __pyx_t_2 = 0;
5233 
5234  /* "imate/traceinv/_hutchinson_method.pyx":746
5235  * # Allocate random array with Fortran ordering (first index is contiguous)
5236  * # 2D array E should be treated as a matrix, random vectors are columns of E
5237  * E = numpy.empty((vector_size, max_num_samples), dtype=numpy.float32, # <<<<<<<<<<<<<<
5238  * order='F')
5239  *
5240  */
5241  __Pyx_TraceLine(746,0,__PYX_ERR(0, 746, __pyx_L1_error))
5242  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
5243  __Pyx_GOTREF(__pyx_t_2);
5244  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
5245  __Pyx_GOTREF(__pyx_t_1);
5246  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5247  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
5248  __Pyx_GOTREF(__pyx_t_2);
5249  __Pyx_INCREF(__pyx_v_vector_size);
5250  __Pyx_GIVEREF(__pyx_v_vector_size);
5251  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vector_size);
5252  __Pyx_INCREF(__pyx_v_max_num_samples);
5253  __Pyx_GIVEREF(__pyx_v_max_num_samples);
5254  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_max_num_samples);
5255  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error)
5256  __Pyx_GOTREF(__pyx_t_3);
5257  __Pyx_GIVEREF(__pyx_t_2);
5258  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
5259  __pyx_t_2 = 0;
5260  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
5261  __Pyx_GOTREF(__pyx_t_2);
5262  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 746, __pyx_L1_error)
5263  __Pyx_GOTREF(__pyx_t_4);
5264  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
5265  __Pyx_GOTREF(__pyx_t_5);
5266  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5267  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
5268  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5269  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
5270  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
5271  __Pyx_GOTREF(__pyx_t_5);
5272  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5273  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5274  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5275  __pyx_v_E = __pyx_t_5;
5276  __pyx_t_5 = 0;
5277 
5278  /* "imate/traceinv/_hutchinson_method.pyx":750
5279  *
5280  * # Get c pointer to E
5281  * cdef float[::1, :] memoryview_E = E # <<<<<<<<<<<<<<
5282  * cdef float* cE = &memoryview_E[0, 0]
5283  *
5284  */
5285  __Pyx_TraceLine(750,0,__PYX_ERR(0, 750, __pyx_L1_error))
5286  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_E, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 750, __pyx_L1_error)
5287  __pyx_v_memoryview_E = __pyx_t_6;
5288  __pyx_t_6.memview = NULL;
5289  __pyx_t_6.data = NULL;
5290 
5291  /* "imate/traceinv/_hutchinson_method.pyx":751
5292  * # Get c pointer to E
5293  * cdef float[::1, :] memoryview_E = E
5294  * cdef float* cE = &memoryview_E[0, 0] # <<<<<<<<<<<<<<
5295  *
5296  * init_tot_wall_time = time.perf_counter()
5297  */
5298  __Pyx_TraceLine(751,0,__PYX_ERR(0, 751, __pyx_L1_error))
5299  __pyx_t_7 = 0;
5300  __pyx_t_8 = 0;
5301  __pyx_v_cE = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_memoryview_E.data) + __pyx_t_7)) ) + __pyx_t_8 * __pyx_v_memoryview_E.strides[1]) ))));
5302 
5303  /* "imate/traceinv/_hutchinson_method.pyx":753
5304  * cdef float* cE = &memoryview_E[0, 0]
5305  *
5306  * init_tot_wall_time = time.perf_counter() # <<<<<<<<<<<<<<
5307  * init_cpu_proc_time = time.process_time()
5308  *
5309  */
5310  __Pyx_TraceLine(753,0,__PYX_ERR(0, 753, __pyx_L1_error))
5311  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
5312  __Pyx_GOTREF(__pyx_t_2);
5313  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error)
5314  __Pyx_GOTREF(__pyx_t_3);
5315  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5316  __pyx_t_2 = NULL;
5317  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5318  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5319  if (likely(__pyx_t_2)) {
5320  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5321  __Pyx_INCREF(__pyx_t_2);
5322  __Pyx_INCREF(function);
5323  __Pyx_DECREF_SET(__pyx_t_3, function);
5324  }
5325  }
5326  __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
5327  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5328  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L1_error)
5329  __Pyx_GOTREF(__pyx_t_5);
5330  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5331  __pyx_v_init_tot_wall_time = __pyx_t_5;
5332  __pyx_t_5 = 0;
5333 
5334  /* "imate/traceinv/_hutchinson_method.pyx":754
5335  *
5336  * init_tot_wall_time = time.perf_counter()
5337  * init_cpu_proc_time = time.process_time() # <<<<<<<<<<<<<<
5338  *
5339  * # Generate orthogonalized random vectors with unit norm
5340  */
5341  __Pyx_TraceLine(754,0,__PYX_ERR(0, 754, __pyx_L1_error))
5342  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error)
5343  __Pyx_GOTREF(__pyx_t_3);
5344  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_process_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
5345  __Pyx_GOTREF(__pyx_t_2);
5346  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5347  __pyx_t_3 = NULL;
5348  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
5349  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
5350  if (likely(__pyx_t_3)) {
5351  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5352  __Pyx_INCREF(__pyx_t_3);
5353  __Pyx_INCREF(function);
5354  __Pyx_DECREF_SET(__pyx_t_2, function);
5355  }
5356  }
5357  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
5358  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5359  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error)
5360  __Pyx_GOTREF(__pyx_t_5);
5361  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5362  __pyx_v_init_cpu_proc_time = __pyx_t_5;
5363  __pyx_t_5 = 0;
5364 
5365  /* "imate/traceinv/_hutchinson_method.pyx":757
5366  *
5367  * # Generate orthogonalized random vectors with unit norm
5368  * generate_random_column_vectors[float](cE, vector_size, max_num_samples, # <<<<<<<<<<<<<<
5369  * int(orthogonalize), num_threads)
5370  *
5371  */
5372  __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
5373  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_vector_size); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
5374  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
5375 
5376  /* "imate/traceinv/_hutchinson_method.pyx":758
5377  * # Generate orthogonalized random vectors with unit norm
5378  * generate_random_column_vectors[float](cE, vector_size, max_num_samples,
5379  * int(orthogonalize), num_threads) # <<<<<<<<<<<<<<
5380  *
5381  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float32)
5382  */
5383  __Pyx_TraceLine(758,0,__PYX_ERR(0, 758, __pyx_L1_error))
5384  __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_orthogonalize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 758, __pyx_L1_error)
5385  __Pyx_GOTREF(__pyx_t_5);
5386  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error)
5387  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5388  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L1_error)
5389 
5390  /* "imate/traceinv/_hutchinson_method.pyx":757
5391  *
5392  * # Generate orthogonalized random vectors with unit norm
5393  * generate_random_column_vectors[float](cE, vector_size, max_num_samples, # <<<<<<<<<<<<<<
5394  * int(orthogonalize), num_threads)
5395  *
5396  */
5397  __Pyx_TraceLine(757,0,__PYX_ERR(0, 757, __pyx_L1_error))
5398  __pyx_fuse_0__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors(__pyx_v_cE, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12);
5399 
5400  /* "imate/traceinv/_hutchinson_method.pyx":760
5401  * int(orthogonalize), num_threads)
5402  *
5403  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float32) # <<<<<<<<<<<<<<
5404  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int)
5405  * samples[:] = numpy.nan
5406  */
5407  __Pyx_TraceLine(760,0,__PYX_ERR(0, 760, __pyx_L1_error))
5408  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
5409  __Pyx_GOTREF(__pyx_t_5);
5410  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error)
5411  __Pyx_GOTREF(__pyx_t_2);
5412  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5413  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
5414  __Pyx_GOTREF(__pyx_t_5);
5415  __Pyx_INCREF(__pyx_v_max_num_samples);
5416  __Pyx_GIVEREF(__pyx_v_max_num_samples);
5417  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_max_num_samples);
5418  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
5419  __Pyx_GOTREF(__pyx_t_3);
5420  __Pyx_GIVEREF(__pyx_t_5);
5421  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
5422  __pyx_t_5 = 0;
5423  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
5424  __Pyx_GOTREF(__pyx_t_5);
5425  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error)
5426  __Pyx_GOTREF(__pyx_t_1);
5427  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
5428  __Pyx_GOTREF(__pyx_t_4);
5429  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5430  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
5431  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5432  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error)
5433  __Pyx_GOTREF(__pyx_t_4);
5434  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5435  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5436  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5437  __pyx_v_samples = __pyx_t_4;
5438  __pyx_t_4 = 0;
5439 
5440  /* "imate/traceinv/_hutchinson_method.pyx":761
5441  *
5442  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float32)
5443  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int) # <<<<<<<<<<<<<<
5444  * samples[:] = numpy.nan
5445  * cdef int num_processed_samples = 0
5446  */
5447  __Pyx_TraceLine(761,0,__PYX_ERR(0, 761, __pyx_L1_error))
5448  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
5449  __Pyx_GOTREF(__pyx_t_4);
5450  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
5451  __Pyx_GOTREF(__pyx_t_5);
5452  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5453  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
5454  __Pyx_GOTREF(__pyx_t_4);
5455  __Pyx_INCREF(__pyx_v_max_num_samples);
5456  __Pyx_GIVEREF(__pyx_v_max_num_samples);
5457  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_max_num_samples);
5458  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error)
5459  __Pyx_GOTREF(__pyx_t_3);
5460  __Pyx_GIVEREF(__pyx_t_4);
5461  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
5462  __pyx_t_4 = 0;
5463  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error)
5464  __Pyx_GOTREF(__pyx_t_4);
5465  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
5466  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
5467  __Pyx_GOTREF(__pyx_t_2);
5468  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5469  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5470  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5471  __pyx_v_processed_samples_indices = __pyx_t_2;
5472  __pyx_t_2 = 0;
5473 
5474  /* "imate/traceinv/_hutchinson_method.pyx":762
5475  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float32)
5476  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int)
5477  * samples[:] = numpy.nan # <<<<<<<<<<<<<<
5478  * cdef int num_processed_samples = 0
5479  * cdef int num_samples_used = 0
5480  */
5481  __Pyx_TraceLine(762,0,__PYX_ERR(0, 762, __pyx_L1_error))
5482  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
5483  __Pyx_GOTREF(__pyx_t_2);
5484  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error)
5485  __Pyx_GOTREF(__pyx_t_4);
5486  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5487  if (__Pyx_PyObject_SetSlice(__pyx_v_samples, __pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 0) < 0) __PYX_ERR(0, 762, __pyx_L1_error)
5488  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5489 
5490  /* "imate/traceinv/_hutchinson_method.pyx":763
5491  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int)
5492  * samples[:] = numpy.nan
5493  * cdef int num_processed_samples = 0 # <<<<<<<<<<<<<<
5494  * cdef int num_samples_used = 0
5495  * cdef int converged = 0
5496  */
5497  __Pyx_TraceLine(763,0,__PYX_ERR(0, 763, __pyx_L1_error))
5498  __pyx_v_num_processed_samples = 0;
5499 
5500  /* "imate/traceinv/_hutchinson_method.pyx":764
5501  * samples[:] = numpy.nan
5502  * cdef int num_processed_samples = 0
5503  * cdef int num_samples_used = 0 # <<<<<<<<<<<<<<
5504  * cdef int converged = 0
5505  *
5506  */
5507  __Pyx_TraceLine(764,0,__PYX_ERR(0, 764, __pyx_L1_error))
5508  __pyx_v_num_samples_used = 0;
5509 
5510  /* "imate/traceinv/_hutchinson_method.pyx":765
5511  * cdef int num_processed_samples = 0
5512  * cdef int num_samples_used = 0
5513  * cdef int converged = 0 # <<<<<<<<<<<<<<
5514  *
5515  * init_alg_wall_time = time.perf_counter()
5516  */
5517  __Pyx_TraceLine(765,0,__PYX_ERR(0, 765, __pyx_L1_error))
5518  __pyx_v_converged = 0;
5519 
5520  /* "imate/traceinv/_hutchinson_method.pyx":767
5521  * cdef int converged = 0
5522  *
5523  * init_alg_wall_time = time.perf_counter() # <<<<<<<<<<<<<<
5524  *
5525  * # Compute Gramian matrix if needed
5526  */
5527  __Pyx_TraceLine(767,0,__PYX_ERR(0, 767, __pyx_L1_error))
5528  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
5529  __Pyx_GOTREF(__pyx_t_2);
5530  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
5531  __Pyx_GOTREF(__pyx_t_3);
5532  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5533  __pyx_t_2 = NULL;
5534  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5535  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
5536  if (likely(__pyx_t_2)) {
5537  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5538  __Pyx_INCREF(__pyx_t_2);
5539  __Pyx_INCREF(function);
5540  __Pyx_DECREF_SET(__pyx_t_3, function);
5541  }
5542  }
5543  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
5544  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5545  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 767, __pyx_L1_error)
5546  __Pyx_GOTREF(__pyx_t_4);
5547  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5548  __pyx_v_init_alg_wall_time = __pyx_t_4;
5549  __pyx_t_4 = 0;
5550 
5551  /* "imate/traceinv/_hutchinson_method.pyx":770
5552  *
5553  * # Compute Gramian matrix if needed
5554  * if gram: # <<<<<<<<<<<<<<
5555  * if (p == 1) and (B is None) and (C is None):
5556  * # This special case does not needed the computation of Gramian.
5557  */
5558  __Pyx_TraceLine(770,0,__PYX_ERR(0, 770, __pyx_L1_error))
5559  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 770, __pyx_L1_error)
5560  if (__pyx_t_13) {
5561 
5562  /* "imate/traceinv/_hutchinson_method.pyx":771
5563  * # Compute Gramian matrix if needed
5564  * if gram:
5565  * if (p == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
5566  * # This special case does not needed the computation of Gramian.
5567  * AtA = None
5568  */
5569  __Pyx_TraceLine(771,0,__PYX_ERR(0, 771, __pyx_L1_error))
5570  __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error)
5571  __Pyx_GOTREF(__pyx_t_4);
5572  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 771, __pyx_L1_error)
5573  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5574  if (__pyx_t_14) {
5575  } else {
5576  __pyx_t_13 = __pyx_t_14;
5577  goto __pyx_L5_bool_binop_done;
5578  }
5579  __pyx_t_14 = (__pyx_v_B == Py_None);
5580  __pyx_t_15 = (__pyx_t_14 != 0);
5581  if (__pyx_t_15) {
5582  } else {
5583  __pyx_t_13 = __pyx_t_15;
5584  goto __pyx_L5_bool_binop_done;
5585  }
5586  __pyx_t_15 = (__pyx_v_C == Py_None);
5587  __pyx_t_14 = (__pyx_t_15 != 0);
5588  __pyx_t_13 = __pyx_t_14;
5589  __pyx_L5_bool_binop_done:;
5590  if (__pyx_t_13) {
5591 
5592  /* "imate/traceinv/_hutchinson_method.pyx":773
5593  * if (p == 1) and (B is None) and (C is None):
5594  * # This special case does not needed the computation of Gramian.
5595  * AtA = None # <<<<<<<<<<<<<<
5596  * else:
5597  * AtA = A.T @ A
5598  */
5599  __Pyx_TraceLine(773,0,__PYX_ERR(0, 773, __pyx_L1_error))
5600  __Pyx_INCREF(Py_None);
5601  __pyx_v_AtA = Py_None;
5602 
5603  /* "imate/traceinv/_hutchinson_method.pyx":771
5604  * # Compute Gramian matrix if needed
5605  * if gram:
5606  * if (p == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
5607  * # This special case does not needed the computation of Gramian.
5608  * AtA = None
5609  */
5610  goto __pyx_L4;
5611  }
5612 
5613  /* "imate/traceinv/_hutchinson_method.pyx":775
5614  * AtA = None
5615  * else:
5616  * AtA = A.T @ A # <<<<<<<<<<<<<<
5617  * else:
5618  * AtA = None
5619  */
5620  __Pyx_TraceLine(775,0,__PYX_ERR(0, 775, __pyx_L1_error))
5621  /*else*/ {
5622  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
5623  __Pyx_GOTREF(__pyx_t_4);
5624  __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_4, __pyx_v_A); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
5625  __Pyx_GOTREF(__pyx_t_3);
5626  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5627  __pyx_v_AtA = __pyx_t_3;
5628  __pyx_t_3 = 0;
5629  }
5630  __pyx_L4:;
5631 
5632  /* "imate/traceinv/_hutchinson_method.pyx":770
5633  *
5634  * # Compute Gramian matrix if needed
5635  * if gram: # <<<<<<<<<<<<<<
5636  * if (p == 1) and (B is None) and (C is None):
5637  * # This special case does not needed the computation of Gramian.
5638  */
5639  goto __pyx_L3;
5640  }
5641 
5642  /* "imate/traceinv/_hutchinson_method.pyx":777
5643  * AtA = A.T @ A
5644  * else:
5645  * AtA = None # <<<<<<<<<<<<<<
5646  *
5647  * # Monte-Carlo sampling
5648  */
5649  __Pyx_TraceLine(777,0,__PYX_ERR(0, 777, __pyx_L1_error))
5650  /*else*/ {
5651  __Pyx_INCREF(Py_None);
5652  __pyx_v_AtA = Py_None;
5653  }
5654  __pyx_L3:;
5655 
5656  /* "imate/traceinv/_hutchinson_method.pyx":780
5657  *
5658  * # Monte-Carlo sampling
5659  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5660  *
5661  * if converged == 0:
5662  */
5663  __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
5664  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_max_num_samples); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
5665  __Pyx_GOTREF(__pyx_t_3);
5666  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
5667  __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0;
5668  __pyx_t_17 = NULL;
5669  } else {
5670  __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 780, __pyx_L1_error)
5671  __Pyx_GOTREF(__pyx_t_4);
5672  __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 780, __pyx_L1_error)
5673  }
5674  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5675  for (;;) {
5676  if (likely(!__pyx_t_17)) {
5677  if (likely(PyList_CheckExact(__pyx_t_4))) {
5678  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4)) break;
5679  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5680  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 780, __pyx_L1_error)
5681  #else
5682  __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
5683  __Pyx_GOTREF(__pyx_t_3);
5684  #endif
5685  } else {
5686  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
5687  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5688  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 780, __pyx_L1_error)
5689  #else
5690  __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
5691  __Pyx_GOTREF(__pyx_t_3);
5692  #endif
5693  }
5694  } else {
5695  __pyx_t_3 = __pyx_t_17(__pyx_t_4);
5696  if (unlikely(!__pyx_t_3)) {
5697  PyObject* exc_type = PyErr_Occurred();
5698  if (exc_type) {
5699  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5700  else __PYX_ERR(0, 780, __pyx_L1_error)
5701  }
5702  break;
5703  }
5704  __Pyx_GOTREF(__pyx_t_3);
5705  }
5706  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
5707  __pyx_t_3 = 0;
5708 
5709  /* "imate/traceinv/_hutchinson_method.pyx":782
5710  * for i in range(max_num_samples):
5711  *
5712  * if converged == 0: # <<<<<<<<<<<<<<
5713  *
5714  * # Stochastic estimator of trace using the i-th column of E
5715  */
5716  __Pyx_TraceLine(782,0,__PYX_ERR(0, 782, __pyx_L1_error))
5717  __pyx_t_13 = ((__pyx_v_converged == 0) != 0);
5718  if (__pyx_t_13) {
5719 
5720  /* "imate/traceinv/_hutchinson_method.pyx":786
5721  * # Stochastic estimator of trace using the i-th column of E
5722  * samples[i] = _stochastic_trace_estimator_float(
5723  * A, AtA, B, C, E[:, i], gram, p, assume_matrix, solver_tol) # <<<<<<<<<<<<<<
5724  *
5725  * # Store the index of processed samples
5726  */
5727  __Pyx_TraceLine(786,0,__PYX_ERR(0, 786, __pyx_L1_error))
5728  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error)
5729  __Pyx_GOTREF(__pyx_t_3);
5730  __Pyx_INCREF(__pyx_slice__4);
5731  __Pyx_GIVEREF(__pyx_slice__4);
5732  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__4);
5733  __Pyx_INCREF(__pyx_v_i);
5734  __Pyx_GIVEREF(__pyx_v_i);
5735  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_i);
5736  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_E, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
5737  __Pyx_GOTREF(__pyx_t_2);
5738  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5739 
5740  /* "imate/traceinv/_hutchinson_method.pyx":785
5741  *
5742  * # Stochastic estimator of trace using the i-th column of E
5743  * samples[i] = _stochastic_trace_estimator_float( # <<<<<<<<<<<<<<
5744  * A, AtA, B, C, E[:, i], gram, p, assume_matrix, solver_tol)
5745  *
5746  */
5747  __Pyx_TraceLine(785,0,__PYX_ERR(0, 785, __pyx_L1_error))
5748  __pyx_t_18 = __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_float(__pyx_v_A, __pyx_v_AtA, __pyx_v_B, __pyx_v_C, __pyx_t_2, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_solver_tol); if (unlikely(__pyx_t_18 == ((float)-1) && PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L1_error)
5749  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5750  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error)
5751  __Pyx_GOTREF(__pyx_t_2);
5752  if (unlikely(PyObject_SetItem(__pyx_v_samples, __pyx_v_i, __pyx_t_2) < 0)) __PYX_ERR(0, 785, __pyx_L1_error)
5753  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5754 
5755  /* "imate/traceinv/_hutchinson_method.pyx":789
5756  *
5757  * # Store the index of processed samples
5758  * processed_samples_indices[num_processed_samples] = i # <<<<<<<<<<<<<<
5759  * num_processed_samples += 1
5760  *
5761  */
5762  __Pyx_TraceLine(789,0,__PYX_ERR(0, 789, __pyx_L1_error))
5763  if (unlikely(__Pyx_SetItemInt(__pyx_v_processed_samples_indices, __pyx_v_num_processed_samples, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 789, __pyx_L1_error)
5764 
5765  /* "imate/traceinv/_hutchinson_method.pyx":790
5766  * # Store the index of processed samples
5767  * processed_samples_indices[num_processed_samples] = i
5768  * num_processed_samples += 1 # <<<<<<<<<<<<<<
5769  *
5770  * # Check whether convergence criterion has been met to stop.
5771  */
5772  __Pyx_TraceLine(790,0,__PYX_ERR(0, 790, __pyx_L1_error))
5773  __pyx_v_num_processed_samples = (__pyx_v_num_processed_samples + 1);
5774 
5775  /* "imate/traceinv/_hutchinson_method.pyx":795
5776  * # This check can also be done after another parallel thread
5777  * # set all_converged to "1", but we continue to update error.
5778  * converged, num_samples_used = check_convergence( # <<<<<<<<<<<<<<
5779  * samples, min_num_samples, processed_samples_indices,
5780  * num_processed_samples, confidence_level, error_atol,
5781  */
5782  __Pyx_TraceLine(795,0,__PYX_ERR(0, 795, __pyx_L1_error))
5783  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_convergence); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
5784  __Pyx_GOTREF(__pyx_t_3);
5785 
5786  /* "imate/traceinv/_hutchinson_method.pyx":797
5787  * converged, num_samples_used = check_convergence(
5788  * samples, min_num_samples, processed_samples_indices,
5789  * num_processed_samples, confidence_level, error_atol, # <<<<<<<<<<<<<<
5790  * error_rtol)
5791  *
5792  */
5793  __Pyx_TraceLine(797,0,__PYX_ERR(0, 797, __pyx_L1_error))
5794  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 797, __pyx_L1_error)
5795  __Pyx_GOTREF(__pyx_t_5);
5796 
5797  /* "imate/traceinv/_hutchinson_method.pyx":798
5798  * samples, min_num_samples, processed_samples_indices,
5799  * num_processed_samples, confidence_level, error_atol,
5800  * error_rtol) # <<<<<<<<<<<<<<
5801  *
5802  * alg_wall_time = time.perf_counter() - init_alg_wall_time
5803  */
5804  __Pyx_TraceLine(798,0,__PYX_ERR(0, 798, __pyx_L1_error))
5805  __pyx_t_1 = NULL;
5806  __pyx_t_19 = 0;
5807  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5808  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
5809  if (likely(__pyx_t_1)) {
5810  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5811  __Pyx_INCREF(__pyx_t_1);
5812  __Pyx_INCREF(function);
5813  __Pyx_DECREF_SET(__pyx_t_3, function);
5814  __pyx_t_19 = 1;
5815  }
5816  }
5817  #if CYTHON_FAST_PYCALL
5818  if (PyFunction_Check(__pyx_t_3)) {
5819  PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
5820  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
5821  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5822  __Pyx_GOTREF(__pyx_t_2);
5823  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5824  } else
5825  #endif
5826  #if CYTHON_FAST_PYCCALL
5827  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5828  PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
5829  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
5830  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5831  __Pyx_GOTREF(__pyx_t_2);
5832  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5833  } else
5834  #endif
5835  {
5836  __pyx_t_20 = PyTuple_New(7+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 795, __pyx_L1_error)
5837  __Pyx_GOTREF(__pyx_t_20);
5838  if (__pyx_t_1) {
5839  __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_1); __pyx_t_1 = NULL;
5840  }
5841  __Pyx_INCREF(__pyx_v_samples);
5842  __Pyx_GIVEREF(__pyx_v_samples);
5843  PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_v_samples);
5844  __Pyx_INCREF(__pyx_v_min_num_samples);
5845  __Pyx_GIVEREF(__pyx_v_min_num_samples);
5846  PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_v_min_num_samples);
5847  __Pyx_INCREF(__pyx_v_processed_samples_indices);
5848  __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
5849  PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_v_processed_samples_indices);
5850  __Pyx_GIVEREF(__pyx_t_5);
5851  PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_5);
5852  __Pyx_INCREF(__pyx_v_confidence_level);
5853  __Pyx_GIVEREF(__pyx_v_confidence_level);
5854  PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_v_confidence_level);
5855  __Pyx_INCREF(__pyx_v_error_atol);
5856  __Pyx_GIVEREF(__pyx_v_error_atol);
5857  PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_v_error_atol);
5858  __Pyx_INCREF(__pyx_v_error_rtol);
5859  __Pyx_GIVEREF(__pyx_v_error_rtol);
5860  PyTuple_SET_ITEM(__pyx_t_20, 6+__pyx_t_19, __pyx_v_error_rtol);
5861  __pyx_t_5 = 0;
5862  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __pyx_L1_error)
5863  __Pyx_GOTREF(__pyx_t_2);
5864  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5865  }
5866  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5867  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
5868  PyObject* sequence = __pyx_t_2;
5869  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5870  if (unlikely(size != 2)) {
5871  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5872  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5873  __PYX_ERR(0, 795, __pyx_L1_error)
5874  }
5875  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5876  if (likely(PyTuple_CheckExact(sequence))) {
5877  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
5878  __pyx_t_20 = PyTuple_GET_ITEM(sequence, 1);
5879  } else {
5880  __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
5881  __pyx_t_20 = PyList_GET_ITEM(sequence, 1);
5882  }
5883  __Pyx_INCREF(__pyx_t_3);
5884  __Pyx_INCREF(__pyx_t_20);
5885  #else
5886  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error)
5887  __Pyx_GOTREF(__pyx_t_3);
5888  __pyx_t_20 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 795, __pyx_L1_error)
5889  __Pyx_GOTREF(__pyx_t_20);
5890  #endif
5891  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5892  } else {
5893  Py_ssize_t index = -1;
5894  __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error)
5895  __Pyx_GOTREF(__pyx_t_5);
5896  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5897  __pyx_t_21 = Py_TYPE(__pyx_t_5)->tp_iternext;
5898  index = 0; __pyx_t_3 = __pyx_t_21(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
5899  __Pyx_GOTREF(__pyx_t_3);
5900  index = 1; __pyx_t_20 = __pyx_t_21(__pyx_t_5); if (unlikely(!__pyx_t_20)) goto __pyx_L11_unpacking_failed;
5901  __Pyx_GOTREF(__pyx_t_20);
5902  if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_5), 2) < 0) __PYX_ERR(0, 795, __pyx_L1_error)
5903  __pyx_t_21 = NULL;
5904  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5905  goto __pyx_L12_unpacking_done;
5906  __pyx_L11_unpacking_failed:;
5907  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5908  __pyx_t_21 = NULL;
5909  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5910  __PYX_ERR(0, 795, __pyx_L1_error)
5911  __pyx_L12_unpacking_done:;
5912  }
5913 
5914  /* "imate/traceinv/_hutchinson_method.pyx":795
5915  * # This check can also be done after another parallel thread
5916  * # set all_converged to "1", but we continue to update error.
5917  * converged, num_samples_used = check_convergence( # <<<<<<<<<<<<<<
5918  * samples, min_num_samples, processed_samples_indices,
5919  * num_processed_samples, confidence_level, error_atol,
5920  */
5921  __Pyx_TraceLine(795,0,__PYX_ERR(0, 795, __pyx_L1_error))
5922  __pyx_t_19 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L1_error)
5923  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5924  __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_20); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 795, __pyx_L1_error)
5925  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5926  __pyx_v_converged = __pyx_t_19;
5927  __pyx_v_num_samples_used = __pyx_t_22;
5928 
5929  /* "imate/traceinv/_hutchinson_method.pyx":782
5930  * for i in range(max_num_samples):
5931  *
5932  * if converged == 0: # <<<<<<<<<<<<<<
5933  *
5934  * # Stochastic estimator of trace using the i-th column of E
5935  */
5936  }
5937 
5938  /* "imate/traceinv/_hutchinson_method.pyx":780
5939  *
5940  * # Monte-Carlo sampling
5941  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
5942  *
5943  * if converged == 0:
5944  */
5945  __Pyx_TraceLine(780,0,__PYX_ERR(0, 780, __pyx_L1_error))
5946  }
5947  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5948 
5949  /* "imate/traceinv/_hutchinson_method.pyx":800
5950  * error_rtol)
5951  *
5952  * alg_wall_time = time.perf_counter() - init_alg_wall_time # <<<<<<<<<<<<<<
5953  *
5954  * trace, error, num_outliers = average_estimates(
5955  */
5956  __Pyx_TraceLine(800,0,__PYX_ERR(0, 800, __pyx_L1_error))
5957  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error)
5958  __Pyx_GOTREF(__pyx_t_2);
5959  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 800, __pyx_L1_error)
5960  __Pyx_GOTREF(__pyx_t_20);
5961  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5962  __pyx_t_2 = NULL;
5963  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
5964  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_20);
5965  if (likely(__pyx_t_2)) {
5966  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
5967  __Pyx_INCREF(__pyx_t_2);
5968  __Pyx_INCREF(function);
5969  __Pyx_DECREF_SET(__pyx_t_20, function);
5970  }
5971  }
5972  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_20);
5973  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5974  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error)
5975  __Pyx_GOTREF(__pyx_t_4);
5976  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5977  __pyx_t_20 = PyNumber_Subtract(__pyx_t_4, __pyx_v_init_alg_wall_time); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 800, __pyx_L1_error)
5978  __Pyx_GOTREF(__pyx_t_20);
5979  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5980  __pyx_v_alg_wall_time = __pyx_t_20;
5981  __pyx_t_20 = 0;
5982 
5983  /* "imate/traceinv/_hutchinson_method.pyx":802
5984  * alg_wall_time = time.perf_counter() - init_alg_wall_time
5985  *
5986  * trace, error, num_outliers = average_estimates( # <<<<<<<<<<<<<<
5987  * confidence_level, outlier_significance_level, max_num_samples,
5988  * num_samples_used, processed_samples_indices, samples)
5989  */
5990  __Pyx_TraceLine(802,0,__PYX_ERR(0, 802, __pyx_L1_error))
5991  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_average_estimates); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
5992  __Pyx_GOTREF(__pyx_t_4);
5993 
5994  /* "imate/traceinv/_hutchinson_method.pyx":804
5995  * trace, error, num_outliers = average_estimates(
5996  * confidence_level, outlier_significance_level, max_num_samples,
5997  * num_samples_used, processed_samples_indices, samples) # <<<<<<<<<<<<<<
5998  *
5999  * tot_wall_time = time.perf_counter() - init_tot_wall_time
6000  */
6001  __Pyx_TraceLine(804,0,__PYX_ERR(0, 804, __pyx_L1_error))
6002  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 804, __pyx_L1_error)
6003  __Pyx_GOTREF(__pyx_t_2);
6004  __pyx_t_3 = NULL;
6005  __pyx_t_22 = 0;
6006  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6007  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
6008  if (likely(__pyx_t_3)) {
6009  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6010  __Pyx_INCREF(__pyx_t_3);
6011  __Pyx_INCREF(function);
6012  __Pyx_DECREF_SET(__pyx_t_4, function);
6013  __pyx_t_22 = 1;
6014  }
6015  }
6016  #if CYTHON_FAST_PYCALL
6017  if (PyFunction_Check(__pyx_t_4)) {
6018  PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
6019  __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 802, __pyx_L1_error)
6020  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6021  __Pyx_GOTREF(__pyx_t_20);
6022  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6023  } else
6024  #endif
6025  #if CYTHON_FAST_PYCCALL
6026  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6027  PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
6028  __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 802, __pyx_L1_error)
6029  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6030  __Pyx_GOTREF(__pyx_t_20);
6031  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6032  } else
6033  #endif
6034  {
6035  __pyx_t_5 = PyTuple_New(6+__pyx_t_22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error)
6036  __Pyx_GOTREF(__pyx_t_5);
6037  if (__pyx_t_3) {
6038  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
6039  }
6040  __Pyx_INCREF(__pyx_v_confidence_level);
6041  __Pyx_GIVEREF(__pyx_v_confidence_level);
6042  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_22, __pyx_v_confidence_level);
6043  __Pyx_INCREF(__pyx_v_outlier_significance_level);
6044  __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
6045  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_22, __pyx_v_outlier_significance_level);
6046  __Pyx_INCREF(__pyx_v_max_num_samples);
6047  __Pyx_GIVEREF(__pyx_v_max_num_samples);
6048  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_22, __pyx_v_max_num_samples);
6049  __Pyx_GIVEREF(__pyx_t_2);
6050  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_22, __pyx_t_2);
6051  __Pyx_INCREF(__pyx_v_processed_samples_indices);
6052  __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
6053  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_22, __pyx_v_processed_samples_indices);
6054  __Pyx_INCREF(__pyx_v_samples);
6055  __Pyx_GIVEREF(__pyx_v_samples);
6056  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_22, __pyx_v_samples);
6057  __pyx_t_2 = 0;
6058  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 802, __pyx_L1_error)
6059  __Pyx_GOTREF(__pyx_t_20);
6060  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6061  }
6062  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6063  if ((likely(PyTuple_CheckExact(__pyx_t_20))) || (PyList_CheckExact(__pyx_t_20))) {
6064  PyObject* sequence = __pyx_t_20;
6065  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6066  if (unlikely(size != 3)) {
6067  if (size > 3) __Pyx_RaiseTooManyValuesError(3);
6068  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6069  __PYX_ERR(0, 802, __pyx_L1_error)
6070  }
6071  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6072  if (likely(PyTuple_CheckExact(sequence))) {
6073  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
6074  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
6075  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
6076  } else {
6077  __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
6078  __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
6079  __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
6080  }
6081  __Pyx_INCREF(__pyx_t_4);
6082  __Pyx_INCREF(__pyx_t_5);
6083  __Pyx_INCREF(__pyx_t_2);
6084  #else
6085  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
6086  __Pyx_GOTREF(__pyx_t_4);
6087  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 802, __pyx_L1_error)
6088  __Pyx_GOTREF(__pyx_t_5);
6089  __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
6090  __Pyx_GOTREF(__pyx_t_2);
6091  #endif
6092  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6093  } else {
6094  Py_ssize_t index = -1;
6095  __pyx_t_3 = PyObject_GetIter(__pyx_t_20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
6096  __Pyx_GOTREF(__pyx_t_3);
6097  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6098  __pyx_t_21 = Py_TYPE(__pyx_t_3)->tp_iternext;
6099  index = 0; __pyx_t_4 = __pyx_t_21(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed;
6100  __Pyx_GOTREF(__pyx_t_4);
6101  index = 1; __pyx_t_5 = __pyx_t_21(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed;
6102  __Pyx_GOTREF(__pyx_t_5);
6103  index = 2; __pyx_t_2 = __pyx_t_21(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
6104  __Pyx_GOTREF(__pyx_t_2);
6105  if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_3), 3) < 0) __PYX_ERR(0, 802, __pyx_L1_error)
6106  __pyx_t_21 = NULL;
6107  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6108  goto __pyx_L14_unpacking_done;
6109  __pyx_L13_unpacking_failed:;
6110  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6111  __pyx_t_21 = NULL;
6112  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6113  __PYX_ERR(0, 802, __pyx_L1_error)
6114  __pyx_L14_unpacking_done:;
6115  }
6116 
6117  /* "imate/traceinv/_hutchinson_method.pyx":802
6118  * alg_wall_time = time.perf_counter() - init_alg_wall_time
6119  *
6120  * trace, error, num_outliers = average_estimates( # <<<<<<<<<<<<<<
6121  * confidence_level, outlier_significance_level, max_num_samples,
6122  * num_samples_used, processed_samples_indices, samples)
6123  */
6124  __Pyx_TraceLine(802,0,__PYX_ERR(0, 802, __pyx_L1_error))
6125  __pyx_v_trace = __pyx_t_4;
6126  __pyx_t_4 = 0;
6127  __pyx_v_error = __pyx_t_5;
6128  __pyx_t_5 = 0;
6129  __pyx_v_num_outliers = __pyx_t_2;
6130  __pyx_t_2 = 0;
6131 
6132  /* "imate/traceinv/_hutchinson_method.pyx":806
6133  * num_samples_used, processed_samples_indices, samples)
6134  *
6135  * tot_wall_time = time.perf_counter() - init_tot_wall_time # <<<<<<<<<<<<<<
6136  * cpu_proc_time = time.process_time() - init_cpu_proc_time
6137  *
6138  */
6139  __Pyx_TraceLine(806,0,__PYX_ERR(0, 806, __pyx_L1_error))
6140  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error)
6141  __Pyx_GOTREF(__pyx_t_2);
6142  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
6143  __Pyx_GOTREF(__pyx_t_5);
6144  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6145  __pyx_t_2 = NULL;
6146  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
6147  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
6148  if (likely(__pyx_t_2)) {
6149  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6150  __Pyx_INCREF(__pyx_t_2);
6151  __Pyx_INCREF(function);
6152  __Pyx_DECREF_SET(__pyx_t_5, function);
6153  }
6154  }
6155  __pyx_t_20 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
6156  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6157  if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 806, __pyx_L1_error)
6158  __Pyx_GOTREF(__pyx_t_20);
6159  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6160  __pyx_t_5 = PyNumber_Subtract(__pyx_t_20, __pyx_v_init_tot_wall_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 806, __pyx_L1_error)
6161  __Pyx_GOTREF(__pyx_t_5);
6162  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6163  __pyx_v_tot_wall_time = __pyx_t_5;
6164  __pyx_t_5 = 0;
6165 
6166  /* "imate/traceinv/_hutchinson_method.pyx":807
6167  *
6168  * tot_wall_time = time.perf_counter() - init_tot_wall_time
6169  * cpu_proc_time = time.process_time() - init_cpu_proc_time # <<<<<<<<<<<<<<
6170  *
6171  * return trace, error, num_outliers, samples, processed_samples_indices, \
6172  */
6173  __Pyx_TraceLine(807,0,__PYX_ERR(0, 807, __pyx_L1_error))
6174  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_time); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 807, __pyx_L1_error)
6175  __Pyx_GOTREF(__pyx_t_20);
6176  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_process_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
6177  __Pyx_GOTREF(__pyx_t_2);
6178  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6179  __pyx_t_20 = NULL;
6180  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6181  __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_2);
6182  if (likely(__pyx_t_20)) {
6183  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6184  __Pyx_INCREF(__pyx_t_20);
6185  __Pyx_INCREF(function);
6186  __Pyx_DECREF_SET(__pyx_t_2, function);
6187  }
6188  }
6189  __pyx_t_5 = (__pyx_t_20) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_20) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6190  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
6191  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 807, __pyx_L1_error)
6192  __Pyx_GOTREF(__pyx_t_5);
6193  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6194  __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_v_init_cpu_proc_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 807, __pyx_L1_error)
6195  __Pyx_GOTREF(__pyx_t_2);
6196  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6197  __pyx_v_cpu_proc_time = __pyx_t_2;
6198  __pyx_t_2 = 0;
6199 
6200  /* "imate/traceinv/_hutchinson_method.pyx":809
6201  * cpu_proc_time = time.process_time() - init_cpu_proc_time
6202  *
6203  * return trace, error, num_outliers, samples, processed_samples_indices, \ # <<<<<<<<<<<<<<
6204  * num_processed_samples, num_samples_used, converged, tot_wall_time, \
6205  * alg_wall_time, cpu_proc_time
6206  */
6207  __Pyx_TraceLine(809,0,__PYX_ERR(0, 809, __pyx_L1_error))
6208  __Pyx_XDECREF(__pyx_r);
6209 
6210  /* "imate/traceinv/_hutchinson_method.pyx":810
6211  *
6212  * return trace, error, num_outliers, samples, processed_samples_indices, \
6213  * num_processed_samples, num_samples_used, converged, tot_wall_time, \ # <<<<<<<<<<<<<<
6214  * alg_wall_time, cpu_proc_time
6215  *
6216  */
6217  __Pyx_TraceLine(810,0,__PYX_ERR(0, 810, __pyx_L1_error))
6218  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 810, __pyx_L1_error)
6219  __Pyx_GOTREF(__pyx_t_2);
6220  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 810, __pyx_L1_error)
6221  __Pyx_GOTREF(__pyx_t_5);
6222  __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_converged); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 810, __pyx_L1_error)
6223  __Pyx_GOTREF(__pyx_t_20);
6224 
6225  /* "imate/traceinv/_hutchinson_method.pyx":809
6226  * cpu_proc_time = time.process_time() - init_cpu_proc_time
6227  *
6228  * return trace, error, num_outliers, samples, processed_samples_indices, \ # <<<<<<<<<<<<<<
6229  * num_processed_samples, num_samples_used, converged, tot_wall_time, \
6230  * alg_wall_time, cpu_proc_time
6231  */
6232  __Pyx_TraceLine(809,0,__PYX_ERR(0, 809, __pyx_L1_error))
6233  __pyx_t_4 = PyTuple_New(11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error)
6234  __Pyx_GOTREF(__pyx_t_4);
6235  __Pyx_INCREF(__pyx_v_trace);
6236  __Pyx_GIVEREF(__pyx_v_trace);
6237  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_trace);
6238  __Pyx_INCREF(__pyx_v_error);
6239  __Pyx_GIVEREF(__pyx_v_error);
6240  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_error);
6241  __Pyx_INCREF(__pyx_v_num_outliers);
6242  __Pyx_GIVEREF(__pyx_v_num_outliers);
6243  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_num_outliers);
6244  __Pyx_INCREF(__pyx_v_samples);
6245  __Pyx_GIVEREF(__pyx_v_samples);
6246  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_samples);
6247  __Pyx_INCREF(__pyx_v_processed_samples_indices);
6248  __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
6249  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_processed_samples_indices);
6250  __Pyx_GIVEREF(__pyx_t_2);
6251  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_2);
6252  __Pyx_GIVEREF(__pyx_t_5);
6253  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_5);
6254  __Pyx_GIVEREF(__pyx_t_20);
6255  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_20);
6256  __Pyx_INCREF(__pyx_v_tot_wall_time);
6257  __Pyx_GIVEREF(__pyx_v_tot_wall_time);
6258  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_v_tot_wall_time);
6259  __Pyx_INCREF(__pyx_v_alg_wall_time);
6260  __Pyx_GIVEREF(__pyx_v_alg_wall_time);
6261  PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_v_alg_wall_time);
6262  __Pyx_INCREF(__pyx_v_cpu_proc_time);
6263  __Pyx_GIVEREF(__pyx_v_cpu_proc_time);
6264  PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_v_cpu_proc_time);
6265  __pyx_t_2 = 0;
6266  __pyx_t_5 = 0;
6267  __pyx_t_20 = 0;
6268  __pyx_r = __pyx_t_4;
6269  __pyx_t_4 = 0;
6270  goto __pyx_L0;
6271 
6272  /* "imate/traceinv/_hutchinson_method.pyx":722
6273  * # =======================
6274  *
6275  * def _hutchinson_method_float( # <<<<<<<<<<<<<<
6276  * A,
6277  * B,
6278  */
6279 
6280  /* function exit code */
6281  __pyx_L1_error:;
6282  __Pyx_XDECREF(__pyx_t_1);
6283  __Pyx_XDECREF(__pyx_t_2);
6284  __Pyx_XDECREF(__pyx_t_3);
6285  __Pyx_XDECREF(__pyx_t_4);
6286  __Pyx_XDECREF(__pyx_t_5);
6287  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6288  __Pyx_XDECREF(__pyx_t_20);
6289  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._hutchinson_method_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6290  __pyx_r = NULL;
6291  __pyx_L0:;
6292  __Pyx_XDECREF(__pyx_v_vector_size);
6293  __Pyx_XDECREF(__pyx_v_E);
6294  __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
6295  __Pyx_XDECREF(__pyx_v_init_tot_wall_time);
6296  __Pyx_XDECREF(__pyx_v_init_cpu_proc_time);
6297  __Pyx_XDECREF(__pyx_v_samples);
6298  __Pyx_XDECREF(__pyx_v_processed_samples_indices);
6299  __Pyx_XDECREF(__pyx_v_init_alg_wall_time);
6300  __Pyx_XDECREF(__pyx_v_AtA);
6301  __Pyx_XDECREF(__pyx_v_i);
6302  __Pyx_XDECREF(__pyx_v_alg_wall_time);
6303  __Pyx_XDECREF(__pyx_v_trace);
6304  __Pyx_XDECREF(__pyx_v_error);
6305  __Pyx_XDECREF(__pyx_v_num_outliers);
6306  __Pyx_XDECREF(__pyx_v_tot_wall_time);
6307  __Pyx_XDECREF(__pyx_v_cpu_proc_time);
6308  __Pyx_XGIVEREF(__pyx_r);
6309  __Pyx_TraceReturn(__pyx_r, 0);
6310  __Pyx_RefNannyFinishContext();
6311  return __pyx_r;
6312 }
6313 
6314 /* "imate/traceinv/_hutchinson_method.pyx":818
6315  * # ========================
6316  *
6317  * def _hutchinson_method_double( # <<<<<<<<<<<<<<
6318  * A,
6319  * B,
6320  */
6321 
6322 /* Python wrapper */
6323 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6324 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double[] = "_hutchinson_method_double(A, B, C, gram, p, assume_matrix, min_num_samples, max_num_samples, error_atol, error_rtol, confidence_level, outlier_significance_level, solver_tol, orthogonalize, num_threads)\n\n This method processes double precision (64-bit) matrix ``A``.\n ";
6325 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double = {"_hutchinson_method_double", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double};
6326 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6327  PyObject *__pyx_v_A = 0;
6328  PyObject *__pyx_v_B = 0;
6329  PyObject *__pyx_v_C = 0;
6330  PyObject *__pyx_v_gram = 0;
6331  PyObject *__pyx_v_p = 0;
6332  PyObject *__pyx_v_assume_matrix = 0;
6333  PyObject *__pyx_v_min_num_samples = 0;
6334  PyObject *__pyx_v_max_num_samples = 0;
6335  PyObject *__pyx_v_error_atol = 0;
6336  PyObject *__pyx_v_error_rtol = 0;
6337  PyObject *__pyx_v_confidence_level = 0;
6338  PyObject *__pyx_v_outlier_significance_level = 0;
6339  PyObject *__pyx_v_solver_tol = 0;
6340  PyObject *__pyx_v_orthogonalize = 0;
6341  PyObject *__pyx_v_num_threads = 0;
6342  int __pyx_lineno = 0;
6343  const char *__pyx_filename = NULL;
6344  int __pyx_clineno = 0;
6345  PyObject *__pyx_r = 0;
6346  __Pyx_RefNannyDeclarations
6347  __Pyx_RefNannySetupContext("_hutchinson_method_double (wrapper)", 0);
6348  {
6349  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_B,&__pyx_n_s_C,&__pyx_n_s_gram,&__pyx_n_s_p,&__pyx_n_s_assume_matrix,&__pyx_n_s_min_num_samples,&__pyx_n_s_max_num_samples,&__pyx_n_s_error_atol,&__pyx_n_s_error_rtol,&__pyx_n_s_confidence_level,&__pyx_n_s_outlier_significance_level,&__pyx_n_s_solver_tol,&__pyx_n_s_orthogonalize,&__pyx_n_s_num_threads,0};
6350  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
6351  if (unlikely(__pyx_kwds)) {
6352  Py_ssize_t kw_args;
6353  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6354  switch (pos_args) {
6355  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6356  CYTHON_FALLTHROUGH;
6357  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6358  CYTHON_FALLTHROUGH;
6359  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6360  CYTHON_FALLTHROUGH;
6361  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6362  CYTHON_FALLTHROUGH;
6363  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6364  CYTHON_FALLTHROUGH;
6365  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6366  CYTHON_FALLTHROUGH;
6367  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6368  CYTHON_FALLTHROUGH;
6369  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6370  CYTHON_FALLTHROUGH;
6371  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6372  CYTHON_FALLTHROUGH;
6373  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6374  CYTHON_FALLTHROUGH;
6375  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6376  CYTHON_FALLTHROUGH;
6377  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6378  CYTHON_FALLTHROUGH;
6379  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6380  CYTHON_FALLTHROUGH;
6381  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6382  CYTHON_FALLTHROUGH;
6383  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6384  CYTHON_FALLTHROUGH;
6385  case 0: break;
6386  default: goto __pyx_L5_argtuple_error;
6387  }
6388  kw_args = PyDict_Size(__pyx_kwds);
6389  switch (pos_args) {
6390  case 0:
6391  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
6392  else goto __pyx_L5_argtuple_error;
6393  CYTHON_FALLTHROUGH;
6394  case 1:
6395  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
6396  else {
6397  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 1); __PYX_ERR(0, 818, __pyx_L3_error)
6398  }
6399  CYTHON_FALLTHROUGH;
6400  case 2:
6401  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_C)) != 0)) kw_args--;
6402  else {
6403  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 2); __PYX_ERR(0, 818, __pyx_L3_error)
6404  }
6405  CYTHON_FALLTHROUGH;
6406  case 3:
6407  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram)) != 0)) kw_args--;
6408  else {
6409  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 3); __PYX_ERR(0, 818, __pyx_L3_error)
6410  }
6411  CYTHON_FALLTHROUGH;
6412  case 4:
6413  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
6414  else {
6415  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 4); __PYX_ERR(0, 818, __pyx_L3_error)
6416  }
6417  CYTHON_FALLTHROUGH;
6418  case 5:
6419  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix)) != 0)) kw_args--;
6420  else {
6421  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 5); __PYX_ERR(0, 818, __pyx_L3_error)
6422  }
6423  CYTHON_FALLTHROUGH;
6424  case 6:
6425  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_num_samples)) != 0)) kw_args--;
6426  else {
6427  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 6); __PYX_ERR(0, 818, __pyx_L3_error)
6428  }
6429  CYTHON_FALLTHROUGH;
6430  case 7:
6431  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_num_samples)) != 0)) kw_args--;
6432  else {
6433  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 7); __PYX_ERR(0, 818, __pyx_L3_error)
6434  }
6435  CYTHON_FALLTHROUGH;
6436  case 8:
6437  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_atol)) != 0)) kw_args--;
6438  else {
6439  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 8); __PYX_ERR(0, 818, __pyx_L3_error)
6440  }
6441  CYTHON_FALLTHROUGH;
6442  case 9:
6443  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_rtol)) != 0)) kw_args--;
6444  else {
6445  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 9); __PYX_ERR(0, 818, __pyx_L3_error)
6446  }
6447  CYTHON_FALLTHROUGH;
6448  case 10:
6449  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidence_level)) != 0)) kw_args--;
6450  else {
6451  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 10); __PYX_ERR(0, 818, __pyx_L3_error)
6452  }
6453  CYTHON_FALLTHROUGH;
6454  case 11:
6455  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_outlier_significance_level)) != 0)) kw_args--;
6456  else {
6457  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 11); __PYX_ERR(0, 818, __pyx_L3_error)
6458  }
6459  CYTHON_FALLTHROUGH;
6460  case 12:
6461  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol)) != 0)) kw_args--;
6462  else {
6463  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 12); __PYX_ERR(0, 818, __pyx_L3_error)
6464  }
6465  CYTHON_FALLTHROUGH;
6466  case 13:
6467  if (likely((values[13] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_orthogonalize)) != 0)) kw_args--;
6468  else {
6469  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 13); __PYX_ERR(0, 818, __pyx_L3_error)
6470  }
6471  CYTHON_FALLTHROUGH;
6472  case 14:
6473  if (likely((values[14] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_num_threads)) != 0)) kw_args--;
6474  else {
6475  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, 14); __PYX_ERR(0, 818, __pyx_L3_error)
6476  }
6477  }
6478  if (unlikely(kw_args > 0)) {
6479  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_hutchinson_method_double") < 0)) __PYX_ERR(0, 818, __pyx_L3_error)
6480  }
6481  } else if (PyTuple_GET_SIZE(__pyx_args) != 15) {
6482  goto __pyx_L5_argtuple_error;
6483  } else {
6484  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6485  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6486  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6487  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6488  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6489  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6490  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6491  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
6492  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
6493  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
6494  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
6495  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
6496  values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
6497  values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
6498  values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
6499  }
6500  __pyx_v_A = values[0];
6501  __pyx_v_B = values[1];
6502  __pyx_v_C = values[2];
6503  __pyx_v_gram = values[3];
6504  __pyx_v_p = values[4];
6505  __pyx_v_assume_matrix = values[5];
6506  __pyx_v_min_num_samples = values[6];
6507  __pyx_v_max_num_samples = values[7];
6508  __pyx_v_error_atol = values[8];
6509  __pyx_v_error_rtol = values[9];
6510  __pyx_v_confidence_level = values[10];
6511  __pyx_v_outlier_significance_level = values[11];
6512  __pyx_v_solver_tol = values[12];
6513  __pyx_v_orthogonalize = values[13];
6514  __pyx_v_num_threads = values[14];
6515  }
6516  goto __pyx_L4_argument_unpacking_done;
6517  __pyx_L5_argtuple_error:;
6518  __Pyx_RaiseArgtupleInvalid("_hutchinson_method_double", 1, 15, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 818, __pyx_L3_error)
6519  __pyx_L3_error:;
6520  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._hutchinson_method_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6521  __Pyx_RefNannyFinishContext();
6522  return NULL;
6523  __pyx_L4_argument_unpacking_done:;
6524  __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double(__pyx_self, __pyx_v_A, __pyx_v_B, __pyx_v_C, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_min_num_samples, __pyx_v_max_num_samples, __pyx_v_error_atol, __pyx_v_error_rtol, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_solver_tol, __pyx_v_orthogonalize, __pyx_v_num_threads);
6525 
6526  /* function exit code */
6527  __Pyx_RefNannyFinishContext();
6528  return __pyx_r;
6529 }
6530 
6531 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_4_hutchinson_method_double(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_min_num_samples, PyObject *__pyx_v_max_num_samples, PyObject *__pyx_v_error_atol, PyObject *__pyx_v_error_rtol, PyObject *__pyx_v_confidence_level, PyObject *__pyx_v_outlier_significance_level, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_orthogonalize, PyObject *__pyx_v_num_threads) {
6532  PyObject *__pyx_v_vector_size = NULL;
6533  PyObject *__pyx_v_E = NULL;
6534  __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
6535  double *__pyx_v_cE;
6536  PyObject *__pyx_v_init_tot_wall_time = NULL;
6537  PyObject *__pyx_v_init_cpu_proc_time = NULL;
6538  PyObject *__pyx_v_samples = NULL;
6539  PyObject *__pyx_v_processed_samples_indices = NULL;
6540  int __pyx_v_num_processed_samples;
6541  int __pyx_v_num_samples_used;
6542  int __pyx_v_converged;
6543  PyObject *__pyx_v_init_alg_wall_time = NULL;
6544  PyObject *__pyx_v_AtA = NULL;
6545  PyObject *__pyx_v_i = NULL;
6546  PyObject *__pyx_v_alg_wall_time = NULL;
6547  PyObject *__pyx_v_trace = NULL;
6548  PyObject *__pyx_v_error = NULL;
6549  PyObject *__pyx_v_num_outliers = NULL;
6550  PyObject *__pyx_v_tot_wall_time = NULL;
6551  PyObject *__pyx_v_cpu_proc_time = NULL;
6552  PyObject *__pyx_r = NULL;
6553  __Pyx_TraceDeclarations
6554  __Pyx_RefNannyDeclarations
6555  PyObject *__pyx_t_1 = NULL;
6556  PyObject *__pyx_t_2 = NULL;
6557  PyObject *__pyx_t_3 = NULL;
6558  PyObject *__pyx_t_4 = NULL;
6559  PyObject *__pyx_t_5 = NULL;
6560  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6561  Py_ssize_t __pyx_t_7;
6562  Py_ssize_t __pyx_t_8;
6563  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_9;
6564  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_10;
6565  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_11;
6566  __pyx_t_5imate_12_definitions_5types_IndexType __pyx_t_12;
6567  int __pyx_t_13;
6568  int __pyx_t_14;
6569  int __pyx_t_15;
6570  Py_ssize_t __pyx_t_16;
6571  PyObject *(*__pyx_t_17)(PyObject *);
6572  double __pyx_t_18;
6573  int __pyx_t_19;
6574  PyObject *__pyx_t_20 = NULL;
6575  PyObject *(*__pyx_t_21)(PyObject *);
6576  int __pyx_t_22;
6577  int __pyx_lineno = 0;
6578  const char *__pyx_filename = NULL;
6579  int __pyx_clineno = 0;
6580  __Pyx_TraceFrameInit(__pyx_codeobj__5)
6581  __Pyx_RefNannySetupContext("_hutchinson_method_double", 0);
6582  __Pyx_TraceCall("_hutchinson_method_double", __pyx_f[0], 818, 0, __PYX_ERR(0, 818, __pyx_L1_error));
6583 
6584  /* "imate/traceinv/_hutchinson_method.pyx":838
6585  * """
6586  *
6587  * vector_size = A.shape[0] # <<<<<<<<<<<<<<
6588  *
6589  * # Allocate random array with Fortran ordering (first index is contiguous)
6590  */
6591  __Pyx_TraceLine(838,0,__PYX_ERR(0, 838, __pyx_L1_error))
6592  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error)
6593  __Pyx_GOTREF(__pyx_t_1);
6594  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
6595  __Pyx_GOTREF(__pyx_t_2);
6596  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6597  __pyx_v_vector_size = __pyx_t_2;
6598  __pyx_t_2 = 0;
6599 
6600  /* "imate/traceinv/_hutchinson_method.pyx":842
6601  * # Allocate random array with Fortran ordering (first index is contiguous)
6602  * # 2D array E should be treated as a matrix, random vectors are columns of E
6603  * E = numpy.empty((vector_size, max_num_samples), dtype=numpy.float64, # <<<<<<<<<<<<<<
6604  * order='F')
6605  *
6606  */
6607  __Pyx_TraceLine(842,0,__PYX_ERR(0, 842, __pyx_L1_error))
6608  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
6609  __Pyx_GOTREF(__pyx_t_2);
6610  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
6611  __Pyx_GOTREF(__pyx_t_1);
6612  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6613  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
6614  __Pyx_GOTREF(__pyx_t_2);
6615  __Pyx_INCREF(__pyx_v_vector_size);
6616  __Pyx_GIVEREF(__pyx_v_vector_size);
6617  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vector_size);
6618  __Pyx_INCREF(__pyx_v_max_num_samples);
6619  __Pyx_GIVEREF(__pyx_v_max_num_samples);
6620  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_max_num_samples);
6621  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error)
6622  __Pyx_GOTREF(__pyx_t_3);
6623  __Pyx_GIVEREF(__pyx_t_2);
6624  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
6625  __pyx_t_2 = 0;
6626  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
6627  __Pyx_GOTREF(__pyx_t_2);
6628  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
6629  __Pyx_GOTREF(__pyx_t_4);
6630  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
6631  __Pyx_GOTREF(__pyx_t_5);
6632  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6633  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 842, __pyx_L1_error)
6634  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6635  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_u_F) < 0) __PYX_ERR(0, 842, __pyx_L1_error)
6636  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
6637  __Pyx_GOTREF(__pyx_t_5);
6638  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6639  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6640  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6641  __pyx_v_E = __pyx_t_5;
6642  __pyx_t_5 = 0;
6643 
6644  /* "imate/traceinv/_hutchinson_method.pyx":846
6645  *
6646  * # Get c pointer to E
6647  * cdef double[::1, :] memoryview_E = E # <<<<<<<<<<<<<<
6648  * cdef double* cE = &memoryview_E[0, 0]
6649  *
6650  */
6651  __Pyx_TraceLine(846,0,__PYX_ERR(0, 846, __pyx_L1_error))
6652  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_E, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 846, __pyx_L1_error)
6653  __pyx_v_memoryview_E = __pyx_t_6;
6654  __pyx_t_6.memview = NULL;
6655  __pyx_t_6.data = NULL;
6656 
6657  /* "imate/traceinv/_hutchinson_method.pyx":847
6658  * # Get c pointer to E
6659  * cdef double[::1, :] memoryview_E = E
6660  * cdef double* cE = &memoryview_E[0, 0] # <<<<<<<<<<<<<<
6661  *
6662  * init_tot_wall_time = time.perf_counter()
6663  */
6664  __Pyx_TraceLine(847,0,__PYX_ERR(0, 847, __pyx_L1_error))
6665  __pyx_t_7 = 0;
6666  __pyx_t_8 = 0;
6667  __pyx_v_cE = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_memoryview_E.data) + __pyx_t_7)) ) + __pyx_t_8 * __pyx_v_memoryview_E.strides[1]) ))));
6668 
6669  /* "imate/traceinv/_hutchinson_method.pyx":849
6670  * cdef double* cE = &memoryview_E[0, 0]
6671  *
6672  * init_tot_wall_time = time.perf_counter() # <<<<<<<<<<<<<<
6673  * init_cpu_proc_time = time.process_time()
6674  *
6675  */
6676  __Pyx_TraceLine(849,0,__PYX_ERR(0, 849, __pyx_L1_error))
6677  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error)
6678  __Pyx_GOTREF(__pyx_t_2);
6679  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error)
6680  __Pyx_GOTREF(__pyx_t_3);
6681  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6682  __pyx_t_2 = NULL;
6683  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6684  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6685  if (likely(__pyx_t_2)) {
6686  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6687  __Pyx_INCREF(__pyx_t_2);
6688  __Pyx_INCREF(function);
6689  __Pyx_DECREF_SET(__pyx_t_3, function);
6690  }
6691  }
6692  __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6693  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6694  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 849, __pyx_L1_error)
6695  __Pyx_GOTREF(__pyx_t_5);
6696  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6697  __pyx_v_init_tot_wall_time = __pyx_t_5;
6698  __pyx_t_5 = 0;
6699 
6700  /* "imate/traceinv/_hutchinson_method.pyx":850
6701  *
6702  * init_tot_wall_time = time.perf_counter()
6703  * init_cpu_proc_time = time.process_time() # <<<<<<<<<<<<<<
6704  *
6705  * # Generate orthogonalized random vectors with unit norm
6706  */
6707  __Pyx_TraceLine(850,0,__PYX_ERR(0, 850, __pyx_L1_error))
6708  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 850, __pyx_L1_error)
6709  __Pyx_GOTREF(__pyx_t_3);
6710  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_process_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 850, __pyx_L1_error)
6711  __Pyx_GOTREF(__pyx_t_2);
6712  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6713  __pyx_t_3 = NULL;
6714  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6715  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6716  if (likely(__pyx_t_3)) {
6717  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6718  __Pyx_INCREF(__pyx_t_3);
6719  __Pyx_INCREF(function);
6720  __Pyx_DECREF_SET(__pyx_t_2, function);
6721  }
6722  }
6723  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6724  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6725  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 850, __pyx_L1_error)
6726  __Pyx_GOTREF(__pyx_t_5);
6727  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6728  __pyx_v_init_cpu_proc_time = __pyx_t_5;
6729  __pyx_t_5 = 0;
6730 
6731  /* "imate/traceinv/_hutchinson_method.pyx":853
6732  *
6733  * # Generate orthogonalized random vectors with unit norm
6734  * generate_random_column_vectors[double](cE, vector_size, max_num_samples, # <<<<<<<<<<<<<<
6735  * int(orthogonalize), num_threads)
6736  *
6737  */
6738  __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
6739  __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_vector_size); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L1_error)
6740  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_max_num_samples); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L1_error)
6741 
6742  /* "imate/traceinv/_hutchinson_method.pyx":854
6743  * # Generate orthogonalized random vectors with unit norm
6744  * generate_random_column_vectors[double](cE, vector_size, max_num_samples,
6745  * int(orthogonalize), num_threads) # <<<<<<<<<<<<<<
6746  *
6747  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float64)
6748  */
6749  __Pyx_TraceLine(854,0,__PYX_ERR(0, 854, __pyx_L1_error))
6750  __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_v_orthogonalize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 854, __pyx_L1_error)
6751  __Pyx_GOTREF(__pyx_t_5);
6752  __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error)
6753  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6754  __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_num_threads); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 854, __pyx_L1_error)
6755 
6756  /* "imate/traceinv/_hutchinson_method.pyx":853
6757  *
6758  * # Generate orthogonalized random vectors with unit norm
6759  * generate_random_column_vectors[double](cE, vector_size, max_num_samples, # <<<<<<<<<<<<<<
6760  * int(orthogonalize), num_threads)
6761  *
6762  */
6763  __Pyx_TraceLine(853,0,__PYX_ERR(0, 853, __pyx_L1_error))
6764  __pyx_fuse_1__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors(__pyx_v_cE, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12);
6765 
6766  /* "imate/traceinv/_hutchinson_method.pyx":856
6767  * int(orthogonalize), num_threads)
6768  *
6769  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float64) # <<<<<<<<<<<<<<
6770  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int)
6771  * samples[:] = numpy.nan
6772  */
6773  __Pyx_TraceLine(856,0,__PYX_ERR(0, 856, __pyx_L1_error))
6774  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
6775  __Pyx_GOTREF(__pyx_t_5);
6776  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error)
6777  __Pyx_GOTREF(__pyx_t_2);
6778  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6779  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
6780  __Pyx_GOTREF(__pyx_t_5);
6781  __Pyx_INCREF(__pyx_v_max_num_samples);
6782  __Pyx_GIVEREF(__pyx_v_max_num_samples);
6783  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_max_num_samples);
6784  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
6785  __Pyx_GOTREF(__pyx_t_3);
6786  __Pyx_GIVEREF(__pyx_t_5);
6787  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
6788  __pyx_t_5 = 0;
6789  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
6790  __Pyx_GOTREF(__pyx_t_5);
6791  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
6792  __Pyx_GOTREF(__pyx_t_1);
6793  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
6794  __Pyx_GOTREF(__pyx_t_4);
6795  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6796  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
6797  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6798  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
6799  __Pyx_GOTREF(__pyx_t_4);
6800  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6801  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6802  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6803  __pyx_v_samples = __pyx_t_4;
6804  __pyx_t_4 = 0;
6805 
6806  /* "imate/traceinv/_hutchinson_method.pyx":857
6807  *
6808  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float64)
6809  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int) # <<<<<<<<<<<<<<
6810  * samples[:] = numpy.nan
6811  * cdef int num_processed_samples = 0
6812  */
6813  __Pyx_TraceLine(857,0,__PYX_ERR(0, 857, __pyx_L1_error))
6814  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
6815  __Pyx_GOTREF(__pyx_t_4);
6816  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error)
6817  __Pyx_GOTREF(__pyx_t_5);
6818  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6819  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
6820  __Pyx_GOTREF(__pyx_t_4);
6821  __Pyx_INCREF(__pyx_v_max_num_samples);
6822  __Pyx_GIVEREF(__pyx_v_max_num_samples);
6823  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_max_num_samples);
6824  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error)
6825  __Pyx_GOTREF(__pyx_t_3);
6826  __Pyx_GIVEREF(__pyx_t_4);
6827  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
6828  __pyx_t_4 = 0;
6829  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 857, __pyx_L1_error)
6830  __Pyx_GOTREF(__pyx_t_4);
6831  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 857, __pyx_L1_error)
6832  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error)
6833  __Pyx_GOTREF(__pyx_t_2);
6834  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6835  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6836  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6837  __pyx_v_processed_samples_indices = __pyx_t_2;
6838  __pyx_t_2 = 0;
6839 
6840  /* "imate/traceinv/_hutchinson_method.pyx":858
6841  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float64)
6842  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int)
6843  * samples[:] = numpy.nan # <<<<<<<<<<<<<<
6844  * cdef int num_processed_samples = 0
6845  * cdef int num_samples_used = 0
6846  */
6847  __Pyx_TraceLine(858,0,__PYX_ERR(0, 858, __pyx_L1_error))
6848  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
6849  __Pyx_GOTREF(__pyx_t_2);
6850  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 858, __pyx_L1_error)
6851  __Pyx_GOTREF(__pyx_t_4);
6852  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6853  if (__Pyx_PyObject_SetSlice(__pyx_v_samples, __pyx_t_4, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 0) < 0) __PYX_ERR(0, 858, __pyx_L1_error)
6854  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6855 
6856  /* "imate/traceinv/_hutchinson_method.pyx":859
6857  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int)
6858  * samples[:] = numpy.nan
6859  * cdef int num_processed_samples = 0 # <<<<<<<<<<<<<<
6860  * cdef int num_samples_used = 0
6861  * cdef int converged = 0
6862  */
6863  __Pyx_TraceLine(859,0,__PYX_ERR(0, 859, __pyx_L1_error))
6864  __pyx_v_num_processed_samples = 0;
6865 
6866  /* "imate/traceinv/_hutchinson_method.pyx":860
6867  * samples[:] = numpy.nan
6868  * cdef int num_processed_samples = 0
6869  * cdef int num_samples_used = 0 # <<<<<<<<<<<<<<
6870  * cdef int converged = 0
6871  *
6872  */
6873  __Pyx_TraceLine(860,0,__PYX_ERR(0, 860, __pyx_L1_error))
6874  __pyx_v_num_samples_used = 0;
6875 
6876  /* "imate/traceinv/_hutchinson_method.pyx":861
6877  * cdef int num_processed_samples = 0
6878  * cdef int num_samples_used = 0
6879  * cdef int converged = 0 # <<<<<<<<<<<<<<
6880  *
6881  * init_alg_wall_time = time.perf_counter()
6882  */
6883  __Pyx_TraceLine(861,0,__PYX_ERR(0, 861, __pyx_L1_error))
6884  __pyx_v_converged = 0;
6885 
6886  /* "imate/traceinv/_hutchinson_method.pyx":863
6887  * cdef int converged = 0
6888  *
6889  * init_alg_wall_time = time.perf_counter() # <<<<<<<<<<<<<<
6890  *
6891  * # Compute Gramian matrix if needed
6892  */
6893  __Pyx_TraceLine(863,0,__PYX_ERR(0, 863, __pyx_L1_error))
6894  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
6895  __Pyx_GOTREF(__pyx_t_2);
6896  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
6897  __Pyx_GOTREF(__pyx_t_3);
6898  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6899  __pyx_t_2 = NULL;
6900  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6901  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6902  if (likely(__pyx_t_2)) {
6903  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6904  __Pyx_INCREF(__pyx_t_2);
6905  __Pyx_INCREF(function);
6906  __Pyx_DECREF_SET(__pyx_t_3, function);
6907  }
6908  }
6909  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
6910  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6911  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 863, __pyx_L1_error)
6912  __Pyx_GOTREF(__pyx_t_4);
6913  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6914  __pyx_v_init_alg_wall_time = __pyx_t_4;
6915  __pyx_t_4 = 0;
6916 
6917  /* "imate/traceinv/_hutchinson_method.pyx":866
6918  *
6919  * # Compute Gramian matrix if needed
6920  * if gram: # <<<<<<<<<<<<<<
6921  * if (p == 1) and (B is None) and (C is None):
6922  * # This special case does not needed the computation of Gramian.
6923  */
6924  __Pyx_TraceLine(866,0,__PYX_ERR(0, 866, __pyx_L1_error))
6925  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 866, __pyx_L1_error)
6926  if (__pyx_t_13) {
6927 
6928  /* "imate/traceinv/_hutchinson_method.pyx":867
6929  * # Compute Gramian matrix if needed
6930  * if gram:
6931  * if (p == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
6932  * # This special case does not needed the computation of Gramian.
6933  * AtA = None
6934  */
6935  __Pyx_TraceLine(867,0,__PYX_ERR(0, 867, __pyx_L1_error))
6936  __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 867, __pyx_L1_error)
6937  __Pyx_GOTREF(__pyx_t_4);
6938  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 867, __pyx_L1_error)
6939  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6940  if (__pyx_t_14) {
6941  } else {
6942  __pyx_t_13 = __pyx_t_14;
6943  goto __pyx_L5_bool_binop_done;
6944  }
6945  __pyx_t_14 = (__pyx_v_B == Py_None);
6946  __pyx_t_15 = (__pyx_t_14 != 0);
6947  if (__pyx_t_15) {
6948  } else {
6949  __pyx_t_13 = __pyx_t_15;
6950  goto __pyx_L5_bool_binop_done;
6951  }
6952  __pyx_t_15 = (__pyx_v_C == Py_None);
6953  __pyx_t_14 = (__pyx_t_15 != 0);
6954  __pyx_t_13 = __pyx_t_14;
6955  __pyx_L5_bool_binop_done:;
6956  if (__pyx_t_13) {
6957 
6958  /* "imate/traceinv/_hutchinson_method.pyx":869
6959  * if (p == 1) and (B is None) and (C is None):
6960  * # This special case does not needed the computation of Gramian.
6961  * AtA = None # <<<<<<<<<<<<<<
6962  * else:
6963  * AtA = A.T @ A
6964  */
6965  __Pyx_TraceLine(869,0,__PYX_ERR(0, 869, __pyx_L1_error))
6966  __Pyx_INCREF(Py_None);
6967  __pyx_v_AtA = Py_None;
6968 
6969  /* "imate/traceinv/_hutchinson_method.pyx":867
6970  * # Compute Gramian matrix if needed
6971  * if gram:
6972  * if (p == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
6973  * # This special case does not needed the computation of Gramian.
6974  * AtA = None
6975  */
6976  goto __pyx_L4;
6977  }
6978 
6979  /* "imate/traceinv/_hutchinson_method.pyx":871
6980  * AtA = None
6981  * else:
6982  * AtA = A.T @ A # <<<<<<<<<<<<<<
6983  * else:
6984  * AtA = None
6985  */
6986  __Pyx_TraceLine(871,0,__PYX_ERR(0, 871, __pyx_L1_error))
6987  /*else*/ {
6988  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 871, __pyx_L1_error)
6989  __Pyx_GOTREF(__pyx_t_4);
6990  __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_t_4, __pyx_v_A); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
6991  __Pyx_GOTREF(__pyx_t_3);
6992  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6993  __pyx_v_AtA = __pyx_t_3;
6994  __pyx_t_3 = 0;
6995  }
6996  __pyx_L4:;
6997 
6998  /* "imate/traceinv/_hutchinson_method.pyx":866
6999  *
7000  * # Compute Gramian matrix if needed
7001  * if gram: # <<<<<<<<<<<<<<
7002  * if (p == 1) and (B is None) and (C is None):
7003  * # This special case does not needed the computation of Gramian.
7004  */
7005  goto __pyx_L3;
7006  }
7007 
7008  /* "imate/traceinv/_hutchinson_method.pyx":873
7009  * AtA = A.T @ A
7010  * else:
7011  * AtA = None # <<<<<<<<<<<<<<
7012  *
7013  * # Monte-Carlo sampling
7014  */
7015  __Pyx_TraceLine(873,0,__PYX_ERR(0, 873, __pyx_L1_error))
7016  /*else*/ {
7017  __Pyx_INCREF(Py_None);
7018  __pyx_v_AtA = Py_None;
7019  }
7020  __pyx_L3:;
7021 
7022  /* "imate/traceinv/_hutchinson_method.pyx":876
7023  *
7024  * # Monte-Carlo sampling
7025  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
7026  *
7027  * if converged == 0:
7028  */
7029  __Pyx_TraceLine(876,0,__PYX_ERR(0, 876, __pyx_L1_error))
7030  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_max_num_samples); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
7031  __Pyx_GOTREF(__pyx_t_3);
7032  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
7033  __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_16 = 0;
7034  __pyx_t_17 = NULL;
7035  } else {
7036  __pyx_t_16 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 876, __pyx_L1_error)
7037  __Pyx_GOTREF(__pyx_t_4);
7038  __pyx_t_17 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 876, __pyx_L1_error)
7039  }
7040  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7041  for (;;) {
7042  if (likely(!__pyx_t_17)) {
7043  if (likely(PyList_CheckExact(__pyx_t_4))) {
7044  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_4)) break;
7045  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7046  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
7047  #else
7048  __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
7049  __Pyx_GOTREF(__pyx_t_3);
7050  #endif
7051  } else {
7052  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
7053  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7054  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
7055  #else
7056  __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 876, __pyx_L1_error)
7057  __Pyx_GOTREF(__pyx_t_3);
7058  #endif
7059  }
7060  } else {
7061  __pyx_t_3 = __pyx_t_17(__pyx_t_4);
7062  if (unlikely(!__pyx_t_3)) {
7063  PyObject* exc_type = PyErr_Occurred();
7064  if (exc_type) {
7065  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7066  else __PYX_ERR(0, 876, __pyx_L1_error)
7067  }
7068  break;
7069  }
7070  __Pyx_GOTREF(__pyx_t_3);
7071  }
7072  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
7073  __pyx_t_3 = 0;
7074 
7075  /* "imate/traceinv/_hutchinson_method.pyx":878
7076  * for i in range(max_num_samples):
7077  *
7078  * if converged == 0: # <<<<<<<<<<<<<<
7079  *
7080  * # Stochastic estimator of trace using the i-th column of E
7081  */
7082  __Pyx_TraceLine(878,0,__PYX_ERR(0, 878, __pyx_L1_error))
7083  __pyx_t_13 = ((__pyx_v_converged == 0) != 0);
7084  if (__pyx_t_13) {
7085 
7086  /* "imate/traceinv/_hutchinson_method.pyx":882
7087  * # Stochastic estimator of trace using the i-th column of E
7088  * samples[i] = _stochastic_trace_estimator_double(
7089  * A, AtA, B, C, E[:, i], gram, p, assume_matrix, solver_tol) # <<<<<<<<<<<<<<
7090  *
7091  * # Store the index of processed samples
7092  */
7093  __Pyx_TraceLine(882,0,__PYX_ERR(0, 882, __pyx_L1_error))
7094  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error)
7095  __Pyx_GOTREF(__pyx_t_3);
7096  __Pyx_INCREF(__pyx_slice__4);
7097  __Pyx_GIVEREF(__pyx_slice__4);
7098  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__4);
7099  __Pyx_INCREF(__pyx_v_i);
7100  __Pyx_GIVEREF(__pyx_v_i);
7101  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_i);
7102  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_E, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
7103  __Pyx_GOTREF(__pyx_t_2);
7104  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7105 
7106  /* "imate/traceinv/_hutchinson_method.pyx":881
7107  *
7108  * # Stochastic estimator of trace using the i-th column of E
7109  * samples[i] = _stochastic_trace_estimator_double( # <<<<<<<<<<<<<<
7110  * A, AtA, B, C, E[:, i], gram, p, assume_matrix, solver_tol)
7111  *
7112  */
7113  __Pyx_TraceLine(881,0,__PYX_ERR(0, 881, __pyx_L1_error))
7114  __pyx_t_18 = __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_double(__pyx_v_A, __pyx_v_AtA, __pyx_v_B, __pyx_v_C, __pyx_t_2, __pyx_v_gram, __pyx_v_p, __pyx_v_assume_matrix, __pyx_v_solver_tol); if (unlikely(__pyx_t_18 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 881, __pyx_L1_error)
7115  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7116  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_18); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error)
7117  __Pyx_GOTREF(__pyx_t_2);
7118  if (unlikely(PyObject_SetItem(__pyx_v_samples, __pyx_v_i, __pyx_t_2) < 0)) __PYX_ERR(0, 881, __pyx_L1_error)
7119  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7120 
7121  /* "imate/traceinv/_hutchinson_method.pyx":885
7122  *
7123  * # Store the index of processed samples
7124  * processed_samples_indices[num_processed_samples] = i # <<<<<<<<<<<<<<
7125  * num_processed_samples += 1
7126  *
7127  */
7128  __Pyx_TraceLine(885,0,__PYX_ERR(0, 885, __pyx_L1_error))
7129  if (unlikely(__Pyx_SetItemInt(__pyx_v_processed_samples_indices, __pyx_v_num_processed_samples, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 0, 0) < 0)) __PYX_ERR(0, 885, __pyx_L1_error)
7130 
7131  /* "imate/traceinv/_hutchinson_method.pyx":886
7132  * # Store the index of processed samples
7133  * processed_samples_indices[num_processed_samples] = i
7134  * num_processed_samples += 1 # <<<<<<<<<<<<<<
7135  *
7136  * # Check whether convergence criterion has been met to stop.
7137  */
7138  __Pyx_TraceLine(886,0,__PYX_ERR(0, 886, __pyx_L1_error))
7139  __pyx_v_num_processed_samples = (__pyx_v_num_processed_samples + 1);
7140 
7141  /* "imate/traceinv/_hutchinson_method.pyx":891
7142  * # This check can also be done after another parallel thread
7143  * # set all_converged to "1", but we continue to update error.
7144  * converged, num_samples_used = check_convergence( # <<<<<<<<<<<<<<
7145  * samples, min_num_samples, processed_samples_indices,
7146  * num_processed_samples, confidence_level, error_atol,
7147  */
7148  __Pyx_TraceLine(891,0,__PYX_ERR(0, 891, __pyx_L1_error))
7149  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_check_convergence); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error)
7150  __Pyx_GOTREF(__pyx_t_3);
7151 
7152  /* "imate/traceinv/_hutchinson_method.pyx":893
7153  * converged, num_samples_used = check_convergence(
7154  * samples, min_num_samples, processed_samples_indices,
7155  * num_processed_samples, confidence_level, error_atol, # <<<<<<<<<<<<<<
7156  * error_rtol)
7157  *
7158  */
7159  __Pyx_TraceLine(893,0,__PYX_ERR(0, 893, __pyx_L1_error))
7160  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
7161  __Pyx_GOTREF(__pyx_t_5);
7162 
7163  /* "imate/traceinv/_hutchinson_method.pyx":894
7164  * samples, min_num_samples, processed_samples_indices,
7165  * num_processed_samples, confidence_level, error_atol,
7166  * error_rtol) # <<<<<<<<<<<<<<
7167  *
7168  * alg_wall_time = time.perf_counter() - init_alg_wall_time
7169  */
7170  __Pyx_TraceLine(894,0,__PYX_ERR(0, 894, __pyx_L1_error))
7171  __pyx_t_1 = NULL;
7172  __pyx_t_19 = 0;
7173  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7174  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
7175  if (likely(__pyx_t_1)) {
7176  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7177  __Pyx_INCREF(__pyx_t_1);
7178  __Pyx_INCREF(function);
7179  __Pyx_DECREF_SET(__pyx_t_3, function);
7180  __pyx_t_19 = 1;
7181  }
7182  }
7183  #if CYTHON_FAST_PYCALL
7184  if (PyFunction_Check(__pyx_t_3)) {
7185  PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
7186  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
7187  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7188  __Pyx_GOTREF(__pyx_t_2);
7189  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7190  } else
7191  #endif
7192  #if CYTHON_FAST_PYCCALL
7193  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
7194  PyObject *__pyx_temp[8] = {__pyx_t_1, __pyx_v_samples, __pyx_v_min_num_samples, __pyx_v_processed_samples_indices, __pyx_t_5, __pyx_v_confidence_level, __pyx_v_error_atol, __pyx_v_error_rtol};
7195  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_19, 7+__pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
7196  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7197  __Pyx_GOTREF(__pyx_t_2);
7198  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7199  } else
7200  #endif
7201  {
7202  __pyx_t_20 = PyTuple_New(7+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 891, __pyx_L1_error)
7203  __Pyx_GOTREF(__pyx_t_20);
7204  if (__pyx_t_1) {
7205  __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_1); __pyx_t_1 = NULL;
7206  }
7207  __Pyx_INCREF(__pyx_v_samples);
7208  __Pyx_GIVEREF(__pyx_v_samples);
7209  PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_v_samples);
7210  __Pyx_INCREF(__pyx_v_min_num_samples);
7211  __Pyx_GIVEREF(__pyx_v_min_num_samples);
7212  PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_v_min_num_samples);
7213  __Pyx_INCREF(__pyx_v_processed_samples_indices);
7214  __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
7215  PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_v_processed_samples_indices);
7216  __Pyx_GIVEREF(__pyx_t_5);
7217  PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_5);
7218  __Pyx_INCREF(__pyx_v_confidence_level);
7219  __Pyx_GIVEREF(__pyx_v_confidence_level);
7220  PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_v_confidence_level);
7221  __Pyx_INCREF(__pyx_v_error_atol);
7222  __Pyx_GIVEREF(__pyx_v_error_atol);
7223  PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_v_error_atol);
7224  __Pyx_INCREF(__pyx_v_error_rtol);
7225  __Pyx_GIVEREF(__pyx_v_error_rtol);
7226  PyTuple_SET_ITEM(__pyx_t_20, 6+__pyx_t_19, __pyx_v_error_rtol);
7227  __pyx_t_5 = 0;
7228  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
7229  __Pyx_GOTREF(__pyx_t_2);
7230  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7231  }
7232  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7233  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
7234  PyObject* sequence = __pyx_t_2;
7235  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7236  if (unlikely(size != 2)) {
7237  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
7238  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7239  __PYX_ERR(0, 891, __pyx_L1_error)
7240  }
7241  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7242  if (likely(PyTuple_CheckExact(sequence))) {
7243  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7244  __pyx_t_20 = PyTuple_GET_ITEM(sequence, 1);
7245  } else {
7246  __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
7247  __pyx_t_20 = PyList_GET_ITEM(sequence, 1);
7248  }
7249  __Pyx_INCREF(__pyx_t_3);
7250  __Pyx_INCREF(__pyx_t_20);
7251  #else
7252  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error)
7253  __Pyx_GOTREF(__pyx_t_3);
7254  __pyx_t_20 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 891, __pyx_L1_error)
7255  __Pyx_GOTREF(__pyx_t_20);
7256  #endif
7257  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7258  } else {
7259  Py_ssize_t index = -1;
7260  __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 891, __pyx_L1_error)
7261  __Pyx_GOTREF(__pyx_t_5);
7262  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7263  __pyx_t_21 = Py_TYPE(__pyx_t_5)->tp_iternext;
7264  index = 0; __pyx_t_3 = __pyx_t_21(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
7265  __Pyx_GOTREF(__pyx_t_3);
7266  index = 1; __pyx_t_20 = __pyx_t_21(__pyx_t_5); if (unlikely(!__pyx_t_20)) goto __pyx_L11_unpacking_failed;
7267  __Pyx_GOTREF(__pyx_t_20);
7268  if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_5), 2) < 0) __PYX_ERR(0, 891, __pyx_L1_error)
7269  __pyx_t_21 = NULL;
7270  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7271  goto __pyx_L12_unpacking_done;
7272  __pyx_L11_unpacking_failed:;
7273  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7274  __pyx_t_21 = NULL;
7275  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7276  __PYX_ERR(0, 891, __pyx_L1_error)
7277  __pyx_L12_unpacking_done:;
7278  }
7279 
7280  /* "imate/traceinv/_hutchinson_method.pyx":891
7281  * # This check can also be done after another parallel thread
7282  * # set all_converged to "1", but we continue to update error.
7283  * converged, num_samples_used = check_convergence( # <<<<<<<<<<<<<<
7284  * samples, min_num_samples, processed_samples_indices,
7285  * num_processed_samples, confidence_level, error_atol,
7286  */
7287  __Pyx_TraceLine(891,0,__PYX_ERR(0, 891, __pyx_L1_error))
7288  __pyx_t_19 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 891, __pyx_L1_error)
7289  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7290  __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_t_20); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 891, __pyx_L1_error)
7291  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7292  __pyx_v_converged = __pyx_t_19;
7293  __pyx_v_num_samples_used = __pyx_t_22;
7294 
7295  /* "imate/traceinv/_hutchinson_method.pyx":878
7296  * for i in range(max_num_samples):
7297  *
7298  * if converged == 0: # <<<<<<<<<<<<<<
7299  *
7300  * # Stochastic estimator of trace using the i-th column of E
7301  */
7302  }
7303 
7304  /* "imate/traceinv/_hutchinson_method.pyx":876
7305  *
7306  * # Monte-Carlo sampling
7307  * for i in range(max_num_samples): # <<<<<<<<<<<<<<
7308  *
7309  * if converged == 0:
7310  */
7311  __Pyx_TraceLine(876,0,__PYX_ERR(0, 876, __pyx_L1_error))
7312  }
7313  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7314 
7315  /* "imate/traceinv/_hutchinson_method.pyx":896
7316  * error_rtol)
7317  *
7318  * alg_wall_time = time.perf_counter() - init_alg_wall_time # <<<<<<<<<<<<<<
7319  *
7320  * trace, error, num_outliers = average_estimates(
7321  */
7322  __Pyx_TraceLine(896,0,__PYX_ERR(0, 896, __pyx_L1_error))
7323  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
7324  __Pyx_GOTREF(__pyx_t_2);
7325  __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 896, __pyx_L1_error)
7326  __Pyx_GOTREF(__pyx_t_20);
7327  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7328  __pyx_t_2 = NULL;
7329  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
7330  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_20);
7331  if (likely(__pyx_t_2)) {
7332  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
7333  __Pyx_INCREF(__pyx_t_2);
7334  __Pyx_INCREF(function);
7335  __Pyx_DECREF_SET(__pyx_t_20, function);
7336  }
7337  }
7338  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_20);
7339  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7340  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 896, __pyx_L1_error)
7341  __Pyx_GOTREF(__pyx_t_4);
7342  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7343  __pyx_t_20 = PyNumber_Subtract(__pyx_t_4, __pyx_v_init_alg_wall_time); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 896, __pyx_L1_error)
7344  __Pyx_GOTREF(__pyx_t_20);
7345  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7346  __pyx_v_alg_wall_time = __pyx_t_20;
7347  __pyx_t_20 = 0;
7348 
7349  /* "imate/traceinv/_hutchinson_method.pyx":898
7350  * alg_wall_time = time.perf_counter() - init_alg_wall_time
7351  *
7352  * trace, error, num_outliers = average_estimates( # <<<<<<<<<<<<<<
7353  * confidence_level, outlier_significance_level, max_num_samples,
7354  * num_samples_used, processed_samples_indices, samples)
7355  */
7356  __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
7357  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_average_estimates); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
7358  __Pyx_GOTREF(__pyx_t_4);
7359 
7360  /* "imate/traceinv/_hutchinson_method.pyx":900
7361  * trace, error, num_outliers = average_estimates(
7362  * confidence_level, outlier_significance_level, max_num_samples,
7363  * num_samples_used, processed_samples_indices, samples) # <<<<<<<<<<<<<<
7364  *
7365  * tot_wall_time = time.perf_counter() - init_tot_wall_time
7366  */
7367  __Pyx_TraceLine(900,0,__PYX_ERR(0, 900, __pyx_L1_error))
7368  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 900, __pyx_L1_error)
7369  __Pyx_GOTREF(__pyx_t_2);
7370  __pyx_t_3 = NULL;
7371  __pyx_t_22 = 0;
7372  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7373  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
7374  if (likely(__pyx_t_3)) {
7375  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7376  __Pyx_INCREF(__pyx_t_3);
7377  __Pyx_INCREF(function);
7378  __Pyx_DECREF_SET(__pyx_t_4, function);
7379  __pyx_t_22 = 1;
7380  }
7381  }
7382  #if CYTHON_FAST_PYCALL
7383  if (PyFunction_Check(__pyx_t_4)) {
7384  PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
7385  __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 898, __pyx_L1_error)
7386  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7387  __Pyx_GOTREF(__pyx_t_20);
7388  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7389  } else
7390  #endif
7391  #if CYTHON_FAST_PYCCALL
7392  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7393  PyObject *__pyx_temp[7] = {__pyx_t_3, __pyx_v_confidence_level, __pyx_v_outlier_significance_level, __pyx_v_max_num_samples, __pyx_t_2, __pyx_v_processed_samples_indices, __pyx_v_samples};
7394  __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_22, 6+__pyx_t_22); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 898, __pyx_L1_error)
7395  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7396  __Pyx_GOTREF(__pyx_t_20);
7397  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7398  } else
7399  #endif
7400  {
7401  __pyx_t_5 = PyTuple_New(6+__pyx_t_22); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
7402  __Pyx_GOTREF(__pyx_t_5);
7403  if (__pyx_t_3) {
7404  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
7405  }
7406  __Pyx_INCREF(__pyx_v_confidence_level);
7407  __Pyx_GIVEREF(__pyx_v_confidence_level);
7408  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_22, __pyx_v_confidence_level);
7409  __Pyx_INCREF(__pyx_v_outlier_significance_level);
7410  __Pyx_GIVEREF(__pyx_v_outlier_significance_level);
7411  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_22, __pyx_v_outlier_significance_level);
7412  __Pyx_INCREF(__pyx_v_max_num_samples);
7413  __Pyx_GIVEREF(__pyx_v_max_num_samples);
7414  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_22, __pyx_v_max_num_samples);
7415  __Pyx_GIVEREF(__pyx_t_2);
7416  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_22, __pyx_t_2);
7417  __Pyx_INCREF(__pyx_v_processed_samples_indices);
7418  __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
7419  PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_22, __pyx_v_processed_samples_indices);
7420  __Pyx_INCREF(__pyx_v_samples);
7421  __Pyx_GIVEREF(__pyx_v_samples);
7422  PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_22, __pyx_v_samples);
7423  __pyx_t_2 = 0;
7424  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 898, __pyx_L1_error)
7425  __Pyx_GOTREF(__pyx_t_20);
7426  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7427  }
7428  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7429  if ((likely(PyTuple_CheckExact(__pyx_t_20))) || (PyList_CheckExact(__pyx_t_20))) {
7430  PyObject* sequence = __pyx_t_20;
7431  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7432  if (unlikely(size != 3)) {
7433  if (size > 3) __Pyx_RaiseTooManyValuesError(3);
7434  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7435  __PYX_ERR(0, 898, __pyx_L1_error)
7436  }
7437  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7438  if (likely(PyTuple_CheckExact(sequence))) {
7439  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
7440  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
7441  __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
7442  } else {
7443  __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
7444  __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
7445  __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
7446  }
7447  __Pyx_INCREF(__pyx_t_4);
7448  __Pyx_INCREF(__pyx_t_5);
7449  __Pyx_INCREF(__pyx_t_2);
7450  #else
7451  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
7452  __Pyx_GOTREF(__pyx_t_4);
7453  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 898, __pyx_L1_error)
7454  __Pyx_GOTREF(__pyx_t_5);
7455  __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
7456  __Pyx_GOTREF(__pyx_t_2);
7457  #endif
7458  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7459  } else {
7460  Py_ssize_t index = -1;
7461  __pyx_t_3 = PyObject_GetIter(__pyx_t_20); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error)
7462  __Pyx_GOTREF(__pyx_t_3);
7463  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7464  __pyx_t_21 = Py_TYPE(__pyx_t_3)->tp_iternext;
7465  index = 0; __pyx_t_4 = __pyx_t_21(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed;
7466  __Pyx_GOTREF(__pyx_t_4);
7467  index = 1; __pyx_t_5 = __pyx_t_21(__pyx_t_3); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed;
7468  __Pyx_GOTREF(__pyx_t_5);
7469  index = 2; __pyx_t_2 = __pyx_t_21(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed;
7470  __Pyx_GOTREF(__pyx_t_2);
7471  if (__Pyx_IternextUnpackEndCheck(__pyx_t_21(__pyx_t_3), 3) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
7472  __pyx_t_21 = NULL;
7473  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7474  goto __pyx_L14_unpacking_done;
7475  __pyx_L13_unpacking_failed:;
7476  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7477  __pyx_t_21 = NULL;
7478  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7479  __PYX_ERR(0, 898, __pyx_L1_error)
7480  __pyx_L14_unpacking_done:;
7481  }
7482 
7483  /* "imate/traceinv/_hutchinson_method.pyx":898
7484  * alg_wall_time = time.perf_counter() - init_alg_wall_time
7485  *
7486  * trace, error, num_outliers = average_estimates( # <<<<<<<<<<<<<<
7487  * confidence_level, outlier_significance_level, max_num_samples,
7488  * num_samples_used, processed_samples_indices, samples)
7489  */
7490  __Pyx_TraceLine(898,0,__PYX_ERR(0, 898, __pyx_L1_error))
7491  __pyx_v_trace = __pyx_t_4;
7492  __pyx_t_4 = 0;
7493  __pyx_v_error = __pyx_t_5;
7494  __pyx_t_5 = 0;
7495  __pyx_v_num_outliers = __pyx_t_2;
7496  __pyx_t_2 = 0;
7497 
7498  /* "imate/traceinv/_hutchinson_method.pyx":902
7499  * num_samples_used, processed_samples_indices, samples)
7500  *
7501  * tot_wall_time = time.perf_counter() - init_tot_wall_time # <<<<<<<<<<<<<<
7502  * cpu_proc_time = time.process_time() - init_cpu_proc_time
7503  *
7504  */
7505  __Pyx_TraceLine(902,0,__PYX_ERR(0, 902, __pyx_L1_error))
7506  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
7507  __Pyx_GOTREF(__pyx_t_2);
7508  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_perf_counter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
7509  __Pyx_GOTREF(__pyx_t_5);
7510  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7511  __pyx_t_2 = NULL;
7512  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7513  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
7514  if (likely(__pyx_t_2)) {
7515  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7516  __Pyx_INCREF(__pyx_t_2);
7517  __Pyx_INCREF(function);
7518  __Pyx_DECREF_SET(__pyx_t_5, function);
7519  }
7520  }
7521  __pyx_t_20 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
7522  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7523  if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 902, __pyx_L1_error)
7524  __Pyx_GOTREF(__pyx_t_20);
7525  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7526  __pyx_t_5 = PyNumber_Subtract(__pyx_t_20, __pyx_v_init_tot_wall_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
7527  __Pyx_GOTREF(__pyx_t_5);
7528  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7529  __pyx_v_tot_wall_time = __pyx_t_5;
7530  __pyx_t_5 = 0;
7531 
7532  /* "imate/traceinv/_hutchinson_method.pyx":903
7533  *
7534  * tot_wall_time = time.perf_counter() - init_tot_wall_time
7535  * cpu_proc_time = time.process_time() - init_cpu_proc_time # <<<<<<<<<<<<<<
7536  *
7537  * return trace, error, num_outliers, samples, processed_samples_indices, \
7538  */
7539  __Pyx_TraceLine(903,0,__PYX_ERR(0, 903, __pyx_L1_error))
7540  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_time); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 903, __pyx_L1_error)
7541  __Pyx_GOTREF(__pyx_t_20);
7542  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_process_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
7543  __Pyx_GOTREF(__pyx_t_2);
7544  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7545  __pyx_t_20 = NULL;
7546  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7547  __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_2);
7548  if (likely(__pyx_t_20)) {
7549  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7550  __Pyx_INCREF(__pyx_t_20);
7551  __Pyx_INCREF(function);
7552  __Pyx_DECREF_SET(__pyx_t_2, function);
7553  }
7554  }
7555  __pyx_t_5 = (__pyx_t_20) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_20) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7556  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
7557  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 903, __pyx_L1_error)
7558  __Pyx_GOTREF(__pyx_t_5);
7559  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7560  __pyx_t_2 = PyNumber_Subtract(__pyx_t_5, __pyx_v_init_cpu_proc_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 903, __pyx_L1_error)
7561  __Pyx_GOTREF(__pyx_t_2);
7562  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7563  __pyx_v_cpu_proc_time = __pyx_t_2;
7564  __pyx_t_2 = 0;
7565 
7566  /* "imate/traceinv/_hutchinson_method.pyx":905
7567  * cpu_proc_time = time.process_time() - init_cpu_proc_time
7568  *
7569  * return trace, error, num_outliers, samples, processed_samples_indices, \ # <<<<<<<<<<<<<<
7570  * num_processed_samples, num_samples_used, converged, tot_wall_time, \
7571  * alg_wall_time, cpu_proc_time
7572  */
7573  __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
7574  __Pyx_XDECREF(__pyx_r);
7575 
7576  /* "imate/traceinv/_hutchinson_method.pyx":906
7577  *
7578  * return trace, error, num_outliers, samples, processed_samples_indices, \
7579  * num_processed_samples, num_samples_used, converged, tot_wall_time, \ # <<<<<<<<<<<<<<
7580  * alg_wall_time, cpu_proc_time
7581  *
7582  */
7583  __Pyx_TraceLine(906,0,__PYX_ERR(0, 906, __pyx_L1_error))
7584  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_num_processed_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
7585  __Pyx_GOTREF(__pyx_t_2);
7586  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_num_samples_used); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 906, __pyx_L1_error)
7587  __Pyx_GOTREF(__pyx_t_5);
7588  __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_converged); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 906, __pyx_L1_error)
7589  __Pyx_GOTREF(__pyx_t_20);
7590 
7591  /* "imate/traceinv/_hutchinson_method.pyx":905
7592  * cpu_proc_time = time.process_time() - init_cpu_proc_time
7593  *
7594  * return trace, error, num_outliers, samples, processed_samples_indices, \ # <<<<<<<<<<<<<<
7595  * num_processed_samples, num_samples_used, converged, tot_wall_time, \
7596  * alg_wall_time, cpu_proc_time
7597  */
7598  __Pyx_TraceLine(905,0,__PYX_ERR(0, 905, __pyx_L1_error))
7599  __pyx_t_4 = PyTuple_New(11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 905, __pyx_L1_error)
7600  __Pyx_GOTREF(__pyx_t_4);
7601  __Pyx_INCREF(__pyx_v_trace);
7602  __Pyx_GIVEREF(__pyx_v_trace);
7603  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_trace);
7604  __Pyx_INCREF(__pyx_v_error);
7605  __Pyx_GIVEREF(__pyx_v_error);
7606  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_error);
7607  __Pyx_INCREF(__pyx_v_num_outliers);
7608  __Pyx_GIVEREF(__pyx_v_num_outliers);
7609  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_num_outliers);
7610  __Pyx_INCREF(__pyx_v_samples);
7611  __Pyx_GIVEREF(__pyx_v_samples);
7612  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_samples);
7613  __Pyx_INCREF(__pyx_v_processed_samples_indices);
7614  __Pyx_GIVEREF(__pyx_v_processed_samples_indices);
7615  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_processed_samples_indices);
7616  __Pyx_GIVEREF(__pyx_t_2);
7617  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_2);
7618  __Pyx_GIVEREF(__pyx_t_5);
7619  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_5);
7620  __Pyx_GIVEREF(__pyx_t_20);
7621  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_20);
7622  __Pyx_INCREF(__pyx_v_tot_wall_time);
7623  __Pyx_GIVEREF(__pyx_v_tot_wall_time);
7624  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_v_tot_wall_time);
7625  __Pyx_INCREF(__pyx_v_alg_wall_time);
7626  __Pyx_GIVEREF(__pyx_v_alg_wall_time);
7627  PyTuple_SET_ITEM(__pyx_t_4, 9, __pyx_v_alg_wall_time);
7628  __Pyx_INCREF(__pyx_v_cpu_proc_time);
7629  __Pyx_GIVEREF(__pyx_v_cpu_proc_time);
7630  PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_v_cpu_proc_time);
7631  __pyx_t_2 = 0;
7632  __pyx_t_5 = 0;
7633  __pyx_t_20 = 0;
7634  __pyx_r = __pyx_t_4;
7635  __pyx_t_4 = 0;
7636  goto __pyx_L0;
7637 
7638  /* "imate/traceinv/_hutchinson_method.pyx":818
7639  * # ========================
7640  *
7641  * def _hutchinson_method_double( # <<<<<<<<<<<<<<
7642  * A,
7643  * B,
7644  */
7645 
7646  /* function exit code */
7647  __pyx_L1_error:;
7648  __Pyx_XDECREF(__pyx_t_1);
7649  __Pyx_XDECREF(__pyx_t_2);
7650  __Pyx_XDECREF(__pyx_t_3);
7651  __Pyx_XDECREF(__pyx_t_4);
7652  __Pyx_XDECREF(__pyx_t_5);
7653  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
7654  __Pyx_XDECREF(__pyx_t_20);
7655  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._hutchinson_method_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
7656  __pyx_r = NULL;
7657  __pyx_L0:;
7658  __Pyx_XDECREF(__pyx_v_vector_size);
7659  __Pyx_XDECREF(__pyx_v_E);
7660  __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
7661  __Pyx_XDECREF(__pyx_v_init_tot_wall_time);
7662  __Pyx_XDECREF(__pyx_v_init_cpu_proc_time);
7663  __Pyx_XDECREF(__pyx_v_samples);
7664  __Pyx_XDECREF(__pyx_v_processed_samples_indices);
7665  __Pyx_XDECREF(__pyx_v_init_alg_wall_time);
7666  __Pyx_XDECREF(__pyx_v_AtA);
7667  __Pyx_XDECREF(__pyx_v_i);
7668  __Pyx_XDECREF(__pyx_v_alg_wall_time);
7669  __Pyx_XDECREF(__pyx_v_trace);
7670  __Pyx_XDECREF(__pyx_v_error);
7671  __Pyx_XDECREF(__pyx_v_num_outliers);
7672  __Pyx_XDECREF(__pyx_v_tot_wall_time);
7673  __Pyx_XDECREF(__pyx_v_cpu_proc_time);
7674  __Pyx_XGIVEREF(__pyx_r);
7675  __Pyx_TraceReturn(__pyx_r, 0);
7676  __Pyx_RefNannyFinishContext();
7677  return __pyx_r;
7678 }
7679 
7680 /* "imate/traceinv/_hutchinson_method.pyx":914
7681  * # ================================
7682  *
7683  * cdef float _stochastic_trace_estimator_float( # <<<<<<<<<<<<<<
7684  * A,
7685  * AtA,
7686  */
7687 
7688 static float __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_float(PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_E, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol) {
7689  PyObject *__pyx_v_OpE = NULL;
7690  __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
7691  float *__pyx_v_cE;
7692  __Pyx_memviewslice __pyx_v_memoryview_OpE = { 0, 0, { 0 }, { 0 }, { 0 } };
7693  float *__pyx_v_cOpE;
7694  int __pyx_v_vector_size;
7695  float __pyx_v_inner_prod;
7696  float __pyx_v_trace_estimate;
7697  float __pyx_r;
7698  __Pyx_TraceDeclarations
7699  __Pyx_RefNannyDeclarations
7700  int __pyx_t_1;
7701  int __pyx_t_2;
7702  int __pyx_t_3;
7703  PyObject *__pyx_t_4 = NULL;
7704  PyObject *__pyx_t_5 = NULL;
7705  PyObject *__pyx_t_6 = NULL;
7706  int __pyx_t_7;
7707  PyObject *__pyx_t_8 = NULL;
7708  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
7709  Py_ssize_t __pyx_t_10;
7710  int __pyx_lineno = 0;
7711  const char *__pyx_filename = NULL;
7712  int __pyx_clineno = 0;
7713  __Pyx_RefNannySetupContext("_stochastic_trace_estimator_float", 0);
7714  __Pyx_TraceCall("_stochastic_trace_estimator_float", __pyx_f[0], 914, 0, __PYX_ERR(0, 914, __pyx_L1_error));
7715 
7716  /* "imate/traceinv/_hutchinson_method.pyx":953
7717  *
7718  * # Check AtA is not None when AtA is needed
7719  * if gram and (AtA is None): # <<<<<<<<<<<<<<
7720  * if not ((p == 1) and (B is None) and (C is None)):
7721  * raise RuntimeError('"AtA" cannot be None.')
7722  */
7723  __Pyx_TraceLine(953,0,__PYX_ERR(0, 953, __pyx_L1_error))
7724  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 953, __pyx_L1_error)
7725  if (__pyx_t_2) {
7726  } else {
7727  __pyx_t_1 = __pyx_t_2;
7728  goto __pyx_L4_bool_binop_done;
7729  }
7730  __pyx_t_2 = (__pyx_v_AtA == Py_None);
7731  __pyx_t_3 = (__pyx_t_2 != 0);
7732  __pyx_t_1 = __pyx_t_3;
7733  __pyx_L4_bool_binop_done:;
7734  if (__pyx_t_1) {
7735 
7736  /* "imate/traceinv/_hutchinson_method.pyx":954
7737  * # Check AtA is not None when AtA is needed
7738  * if gram and (AtA is None):
7739  * if not ((p == 1) and (B is None) and (C is None)): # <<<<<<<<<<<<<<
7740  * raise RuntimeError('"AtA" cannot be None.')
7741  *
7742  */
7743  __Pyx_TraceLine(954,0,__PYX_ERR(0, 954, __pyx_L1_error))
7744  __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 954, __pyx_L1_error)
7745  __Pyx_GOTREF(__pyx_t_4);
7746  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 954, __pyx_L1_error)
7747  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7748  if (__pyx_t_3) {
7749  } else {
7750  __pyx_t_1 = __pyx_t_3;
7751  goto __pyx_L7_bool_binop_done;
7752  }
7753  __pyx_t_3 = (__pyx_v_B == Py_None);
7754  __pyx_t_2 = (__pyx_t_3 != 0);
7755  if (__pyx_t_2) {
7756  } else {
7757  __pyx_t_1 = __pyx_t_2;
7758  goto __pyx_L7_bool_binop_done;
7759  }
7760  __pyx_t_2 = (__pyx_v_C == Py_None);
7761  __pyx_t_3 = (__pyx_t_2 != 0);
7762  __pyx_t_1 = __pyx_t_3;
7763  __pyx_L7_bool_binop_done:;
7764  __pyx_t_3 = ((!__pyx_t_1) != 0);
7765  if (unlikely(__pyx_t_3)) {
7766 
7767  /* "imate/traceinv/_hutchinson_method.pyx":955
7768  * if gram and (AtA is None):
7769  * if not ((p == 1) and (B is None) and (C is None)):
7770  * raise RuntimeError('"AtA" cannot be None.') # <<<<<<<<<<<<<<
7771  *
7772  * # Multiply operator * B * E
7773  */
7774  __Pyx_TraceLine(955,0,__PYX_ERR(0, 955, __pyx_L1_error))
7775  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 955, __pyx_L1_error)
7776  __Pyx_GOTREF(__pyx_t_4);
7777  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7778  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7779  __PYX_ERR(0, 955, __pyx_L1_error)
7780 
7781  /* "imate/traceinv/_hutchinson_method.pyx":954
7782  * # Check AtA is not None when AtA is needed
7783  * if gram and (AtA is None):
7784  * if not ((p == 1) and (B is None) and (C is None)): # <<<<<<<<<<<<<<
7785  * raise RuntimeError('"AtA" cannot be None.')
7786  *
7787  */
7788  }
7789 
7790  /* "imate/traceinv/_hutchinson_method.pyx":953
7791  *
7792  * # Check AtA is not None when AtA is needed
7793  * if gram and (AtA is None): # <<<<<<<<<<<<<<
7794  * if not ((p == 1) and (B is None) and (C is None)):
7795  * raise RuntimeError('"AtA" cannot be None.')
7796  */
7797  }
7798 
7799  /* "imate/traceinv/_hutchinson_method.pyx":958
7800  *
7801  * # Multiply operator * B * E
7802  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E) # <<<<<<<<<<<<<<
7803  *
7804  * # Multiply operator * C * OpE
7805  */
7806  __Pyx_TraceLine(958,0,__PYX_ERR(0, 958, __pyx_L1_error))
7807  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L1_error)
7808  __Pyx_GOTREF(__pyx_t_5);
7809  __pyx_t_6 = NULL;
7810  __pyx_t_7 = 0;
7811  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7812  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7813  if (likely(__pyx_t_6)) {
7814  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7815  __Pyx_INCREF(__pyx_t_6);
7816  __Pyx_INCREF(function);
7817  __Pyx_DECREF_SET(__pyx_t_5, function);
7818  __pyx_t_7 = 1;
7819  }
7820  }
7821  #if CYTHON_FAST_PYCALL
7822  if (PyFunction_Check(__pyx_t_5)) {
7823  PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
7824  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
7825  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7826  __Pyx_GOTREF(__pyx_t_4);
7827  } else
7828  #endif
7829  #if CYTHON_FAST_PYCCALL
7830  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7831  PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
7832  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
7833  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7834  __Pyx_GOTREF(__pyx_t_4);
7835  } else
7836  #endif
7837  {
7838  __pyx_t_8 = PyTuple_New(8+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 958, __pyx_L1_error)
7839  __Pyx_GOTREF(__pyx_t_8);
7840  if (__pyx_t_6) {
7841  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
7842  }
7843  __Pyx_INCREF(__pyx_v_A);
7844  __Pyx_GIVEREF(__pyx_v_A);
7845  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_A);
7846  __Pyx_INCREF(__pyx_v_AtA);
7847  __Pyx_GIVEREF(__pyx_v_AtA);
7848  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_AtA);
7849  __Pyx_INCREF(__pyx_v_p);
7850  __Pyx_GIVEREF(__pyx_v_p);
7851  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_p);
7852  __Pyx_INCREF(__pyx_v_gram);
7853  __Pyx_GIVEREF(__pyx_v_gram);
7854  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_gram);
7855  __Pyx_INCREF(__pyx_v_assume_matrix);
7856  __Pyx_GIVEREF(__pyx_v_assume_matrix);
7857  PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_v_assume_matrix);
7858  __Pyx_INCREF(__pyx_v_solver_tol);
7859  __Pyx_GIVEREF(__pyx_v_solver_tol);
7860  PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_v_solver_tol);
7861  __Pyx_INCREF(__pyx_v_B);
7862  __Pyx_GIVEREF(__pyx_v_B);
7863  PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_7, __pyx_v_B);
7864  __Pyx_INCREF(__pyx_v_E);
7865  __Pyx_GIVEREF(__pyx_v_E);
7866  PyTuple_SET_ITEM(__pyx_t_8, 7+__pyx_t_7, __pyx_v_E);
7867  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 958, __pyx_L1_error)
7868  __Pyx_GOTREF(__pyx_t_4);
7869  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7870  }
7871  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7872  __pyx_v_OpE = __pyx_t_4;
7873  __pyx_t_4 = 0;
7874 
7875  /* "imate/traceinv/_hutchinson_method.pyx":961
7876  *
7877  * # Multiply operator * C * OpE
7878  * if C is not None: # <<<<<<<<<<<<<<
7879  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, C, OpE)
7880  *
7881  */
7882  __Pyx_TraceLine(961,0,__PYX_ERR(0, 961, __pyx_L1_error))
7883  __pyx_t_3 = (__pyx_v_C != Py_None);
7884  __pyx_t_1 = (__pyx_t_3 != 0);
7885  if (__pyx_t_1) {
7886 
7887  /* "imate/traceinv/_hutchinson_method.pyx":962
7888  * # Multiply operator * C * OpE
7889  * if C is not None:
7890  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, C, OpE) # <<<<<<<<<<<<<<
7891  *
7892  * # Get c pointer to E
7893  */
7894  __Pyx_TraceLine(962,0,__PYX_ERR(0, 962, __pyx_L1_error))
7895  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error)
7896  __Pyx_GOTREF(__pyx_t_5);
7897  __pyx_t_8 = NULL;
7898  __pyx_t_7 = 0;
7899  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
7900  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
7901  if (likely(__pyx_t_8)) {
7902  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7903  __Pyx_INCREF(__pyx_t_8);
7904  __Pyx_INCREF(function);
7905  __Pyx_DECREF_SET(__pyx_t_5, function);
7906  __pyx_t_7 = 1;
7907  }
7908  }
7909  #if CYTHON_FAST_PYCALL
7910  if (PyFunction_Check(__pyx_t_5)) {
7911  PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
7912  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error)
7913  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7914  __Pyx_GOTREF(__pyx_t_4);
7915  } else
7916  #endif
7917  #if CYTHON_FAST_PYCCALL
7918  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
7919  PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
7920  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error)
7921  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7922  __Pyx_GOTREF(__pyx_t_4);
7923  } else
7924  #endif
7925  {
7926  __pyx_t_6 = PyTuple_New(8+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 962, __pyx_L1_error)
7927  __Pyx_GOTREF(__pyx_t_6);
7928  if (__pyx_t_8) {
7929  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
7930  }
7931  __Pyx_INCREF(__pyx_v_A);
7932  __Pyx_GIVEREF(__pyx_v_A);
7933  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_A);
7934  __Pyx_INCREF(__pyx_v_AtA);
7935  __Pyx_GIVEREF(__pyx_v_AtA);
7936  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_AtA);
7937  __Pyx_INCREF(__pyx_v_p);
7938  __Pyx_GIVEREF(__pyx_v_p);
7939  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_p);
7940  __Pyx_INCREF(__pyx_v_gram);
7941  __Pyx_GIVEREF(__pyx_v_gram);
7942  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_gram);
7943  __Pyx_INCREF(__pyx_v_assume_matrix);
7944  __Pyx_GIVEREF(__pyx_v_assume_matrix);
7945  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_7, __pyx_v_assume_matrix);
7946  __Pyx_INCREF(__pyx_v_solver_tol);
7947  __Pyx_GIVEREF(__pyx_v_solver_tol);
7948  PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_7, __pyx_v_solver_tol);
7949  __Pyx_INCREF(__pyx_v_C);
7950  __Pyx_GIVEREF(__pyx_v_C);
7951  PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_7, __pyx_v_C);
7952  __Pyx_INCREF(__pyx_v_OpE);
7953  __Pyx_GIVEREF(__pyx_v_OpE);
7954  PyTuple_SET_ITEM(__pyx_t_6, 7+__pyx_t_7, __pyx_v_OpE);
7955  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 962, __pyx_L1_error)
7956  __Pyx_GOTREF(__pyx_t_4);
7957  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7958  }
7959  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7960  __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_4);
7961  __pyx_t_4 = 0;
7962 
7963  /* "imate/traceinv/_hutchinson_method.pyx":961
7964  *
7965  * # Multiply operator * C * OpE
7966  * if C is not None: # <<<<<<<<<<<<<<
7967  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, C, OpE)
7968  *
7969  */
7970  }
7971 
7972  /* "imate/traceinv/_hutchinson_method.pyx":965
7973  *
7974  * # Get c pointer to E
7975  * cdef float[:] memoryview_E = E # <<<<<<<<<<<<<<
7976  * cdef float* cE = &memoryview_E[0]
7977  *
7978  */
7979  __Pyx_TraceLine(965,0,__PYX_ERR(0, 965, __pyx_L1_error))
7980  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_E, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 965, __pyx_L1_error)
7981  __pyx_v_memoryview_E = __pyx_t_9;
7982  __pyx_t_9.memview = NULL;
7983  __pyx_t_9.data = NULL;
7984 
7985  /* "imate/traceinv/_hutchinson_method.pyx":966
7986  * # Get c pointer to E
7987  * cdef float[:] memoryview_E = E
7988  * cdef float* cE = &memoryview_E[0] # <<<<<<<<<<<<<<
7989  *
7990  * # Get c pointer to OpE.
7991  */
7992  __Pyx_TraceLine(966,0,__PYX_ERR(0, 966, __pyx_L1_error))
7993  __pyx_t_10 = 0;
7994  __pyx_v_cE = (&(*((float *) ( /* dim=0 */ (__pyx_v_memoryview_E.data + __pyx_t_10 * __pyx_v_memoryview_E.strides[0]) ))));
7995 
7996  /* "imate/traceinv/_hutchinson_method.pyx":969
7997  *
7998  * # Get c pointer to OpE.
7999  * cdef float[:] memoryview_OpE = OpE # <<<<<<<<<<<<<<
8000  * cdef float* cOpE = &memoryview_OpE[0]
8001  *
8002  */
8003  __Pyx_TraceLine(969,0,__PYX_ERR(0, 969, __pyx_L1_error))
8004  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_OpE, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 969, __pyx_L1_error)
8005  __pyx_v_memoryview_OpE = __pyx_t_9;
8006  __pyx_t_9.memview = NULL;
8007  __pyx_t_9.data = NULL;
8008 
8009  /* "imate/traceinv/_hutchinson_method.pyx":970
8010  * # Get c pointer to OpE.
8011  * cdef float[:] memoryview_OpE = OpE
8012  * cdef float* cOpE = &memoryview_OpE[0] # <<<<<<<<<<<<<<
8013  *
8014  * # Inner product of E and OpE
8015  */
8016  __Pyx_TraceLine(970,0,__PYX_ERR(0, 970, __pyx_L1_error))
8017  __pyx_t_10 = 0;
8018  __pyx_v_cOpE = (&(*((float *) ( /* dim=0 */ (__pyx_v_memoryview_OpE.data + __pyx_t_10 * __pyx_v_memoryview_OpE.strides[0]) ))));
8019 
8020  /* "imate/traceinv/_hutchinson_method.pyx":973
8021  *
8022  * # Inner product of E and OpE
8023  * cdef int vector_size = A.shape[0] # <<<<<<<<<<<<<<
8024  * cdef float inner_prod
8025  *
8026  */
8027  __Pyx_TraceLine(973,0,__PYX_ERR(0, 973, __pyx_L1_error))
8028  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 973, __pyx_L1_error)
8029  __Pyx_GOTREF(__pyx_t_4);
8030  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
8031  __Pyx_GOTREF(__pyx_t_5);
8032  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8033  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error)
8034  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8035  __pyx_v_vector_size = __pyx_t_7;
8036 
8037  /* "imate/traceinv/_hutchinson_method.pyx":976
8038  * cdef float inner_prod
8039  *
8040  * if gram and (numpy.abs(p) == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
8041  * inner_prod = cVectorOperations[float].inner_product(cOpE, cOpE,
8042  * vector_size)
8043  */
8044  __Pyx_TraceLine(976,0,__PYX_ERR(0, 976, __pyx_L1_error))
8045  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
8046  if (__pyx_t_3) {
8047  } else {
8048  __pyx_t_1 = __pyx_t_3;
8049  goto __pyx_L12_bool_binop_done;
8050  }
8051  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
8052  __Pyx_GOTREF(__pyx_t_4);
8053  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error)
8054  __Pyx_GOTREF(__pyx_t_6);
8055  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8056  __pyx_t_4 = NULL;
8057  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8058  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8059  if (likely(__pyx_t_4)) {
8060  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8061  __Pyx_INCREF(__pyx_t_4);
8062  __Pyx_INCREF(function);
8063  __Pyx_DECREF_SET(__pyx_t_6, function);
8064  }
8065  }
8066  __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_p);
8067  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8068  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
8069  __Pyx_GOTREF(__pyx_t_5);
8070  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8071  __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 976, __pyx_L1_error)
8072  __Pyx_GOTREF(__pyx_t_6);
8073  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8074  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
8075  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8076  if (__pyx_t_3) {
8077  } else {
8078  __pyx_t_1 = __pyx_t_3;
8079  goto __pyx_L12_bool_binop_done;
8080  }
8081  __pyx_t_3 = (__pyx_v_B == Py_None);
8082  __pyx_t_2 = (__pyx_t_3 != 0);
8083  if (__pyx_t_2) {
8084  } else {
8085  __pyx_t_1 = __pyx_t_2;
8086  goto __pyx_L12_bool_binop_done;
8087  }
8088  __pyx_t_2 = (__pyx_v_C == Py_None);
8089  __pyx_t_3 = (__pyx_t_2 != 0);
8090  __pyx_t_1 = __pyx_t_3;
8091  __pyx_L12_bool_binop_done:;
8092  if (__pyx_t_1) {
8093 
8094  /* "imate/traceinv/_hutchinson_method.pyx":977
8095  *
8096  * if gram and (numpy.abs(p) == 1) and (B is None) and (C is None):
8097  * inner_prod = cVectorOperations[float].inner_product(cOpE, cOpE, # <<<<<<<<<<<<<<
8098  * vector_size)
8099  * else:
8100  */
8101  __Pyx_TraceLine(977,0,__PYX_ERR(0, 977, __pyx_L1_error))
8102  __pyx_v_inner_prod = cVectorOperations<float> ::inner_product(__pyx_v_cOpE, __pyx_v_cOpE, __pyx_v_vector_size);
8103 
8104  /* "imate/traceinv/_hutchinson_method.pyx":976
8105  * cdef float inner_prod
8106  *
8107  * if gram and (numpy.abs(p) == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
8108  * inner_prod = cVectorOperations[float].inner_product(cOpE, cOpE,
8109  * vector_size)
8110  */
8111  goto __pyx_L11;
8112  }
8113 
8114  /* "imate/traceinv/_hutchinson_method.pyx":980
8115  * vector_size)
8116  * else:
8117  * inner_prod = cVectorOperations[float].inner_product(cE, cOpE, # <<<<<<<<<<<<<<
8118  * vector_size)
8119  *
8120  */
8121  __Pyx_TraceLine(980,0,__PYX_ERR(0, 980, __pyx_L1_error))
8122  /*else*/ {
8123 
8124  /* "imate/traceinv/_hutchinson_method.pyx":981
8125  * else:
8126  * inner_prod = cVectorOperations[float].inner_product(cE, cOpE,
8127  * vector_size) # <<<<<<<<<<<<<<
8128  *
8129  * # Hutcinson trace estimate
8130  */
8131  __Pyx_TraceLine(981,0,__PYX_ERR(0, 981, __pyx_L1_error))
8132  __pyx_v_inner_prod = cVectorOperations<float> ::inner_product(__pyx_v_cE, __pyx_v_cOpE, __pyx_v_vector_size);
8133  }
8134  __pyx_L11:;
8135 
8136  /* "imate/traceinv/_hutchinson_method.pyx":984
8137  *
8138  * # Hutcinson trace estimate
8139  * cdef float trace_estimate = vector_size * inner_prod # <<<<<<<<<<<<<<
8140  *
8141  * return trace_estimate
8142  */
8143  __Pyx_TraceLine(984,0,__PYX_ERR(0, 984, __pyx_L1_error))
8144  __pyx_v_trace_estimate = (__pyx_v_vector_size * __pyx_v_inner_prod);
8145 
8146  /* "imate/traceinv/_hutchinson_method.pyx":986
8147  * cdef float trace_estimate = vector_size * inner_prod
8148  *
8149  * return trace_estimate # <<<<<<<<<<<<<<
8150  *
8151  *
8152  */
8153  __Pyx_TraceLine(986,0,__PYX_ERR(0, 986, __pyx_L1_error))
8154  __pyx_r = __pyx_v_trace_estimate;
8155  goto __pyx_L0;
8156 
8157  /* "imate/traceinv/_hutchinson_method.pyx":914
8158  * # ================================
8159  *
8160  * cdef float _stochastic_trace_estimator_float( # <<<<<<<<<<<<<<
8161  * A,
8162  * AtA,
8163  */
8164 
8165  /* function exit code */
8166  __pyx_L1_error:;
8167  __Pyx_XDECREF(__pyx_t_4);
8168  __Pyx_XDECREF(__pyx_t_5);
8169  __Pyx_XDECREF(__pyx_t_6);
8170  __Pyx_XDECREF(__pyx_t_8);
8171  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
8172  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._stochastic_trace_estimator_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
8173  __pyx_r = -1;
8174  __pyx_L0:;
8175  __Pyx_XDECREF(__pyx_v_OpE);
8176  __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
8177  __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_OpE, 1);
8178  __Pyx_TraceReturn(Py_None, 0);
8179  __Pyx_RefNannyFinishContext();
8180  return __pyx_r;
8181 }
8182 
8183 /* "imate/traceinv/_hutchinson_method.pyx":993
8184  * # =================================
8185  *
8186  * cdef double _stochastic_trace_estimator_double( # <<<<<<<<<<<<<<
8187  * A,
8188  * AtA,
8189  */
8190 
8191 static double __pyx_f_5imate_8traceinv_18_hutchinson_method__stochastic_trace_estimator_double(PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_B, PyObject *__pyx_v_C, PyObject *__pyx_v_E, PyObject *__pyx_v_gram, PyObject *__pyx_v_p, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol) {
8192  PyObject *__pyx_v_OpE = NULL;
8193  __Pyx_memviewslice __pyx_v_memoryview_E = { 0, 0, { 0 }, { 0 }, { 0 } };
8194  double *__pyx_v_cE;
8195  __Pyx_memviewslice __pyx_v_memoryview_OpE = { 0, 0, { 0 }, { 0 }, { 0 } };
8196  double *__pyx_v_cOpE;
8197  int __pyx_v_vector_size;
8198  double __pyx_v_inner_prod;
8199  double __pyx_v_trace_estimate;
8200  double __pyx_r;
8201  __Pyx_TraceDeclarations
8202  __Pyx_RefNannyDeclarations
8203  int __pyx_t_1;
8204  int __pyx_t_2;
8205  int __pyx_t_3;
8206  PyObject *__pyx_t_4 = NULL;
8207  PyObject *__pyx_t_5 = NULL;
8208  PyObject *__pyx_t_6 = NULL;
8209  int __pyx_t_7;
8210  PyObject *__pyx_t_8 = NULL;
8211  __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
8212  Py_ssize_t __pyx_t_10;
8213  int __pyx_lineno = 0;
8214  const char *__pyx_filename = NULL;
8215  int __pyx_clineno = 0;
8216  __Pyx_RefNannySetupContext("_stochastic_trace_estimator_double", 0);
8217  __Pyx_TraceCall("_stochastic_trace_estimator_double", __pyx_f[0], 993, 0, __PYX_ERR(0, 993, __pyx_L1_error));
8218 
8219  /* "imate/traceinv/_hutchinson_method.pyx":1032
8220  *
8221  * # Check AtA is not None when AtA is needed
8222  * if gram and (AtA is None): # <<<<<<<<<<<<<<
8223  * if not ((p == 1) and (B is None) and (C is None)):
8224  * raise RuntimeError('"AtA" cannot be None.')
8225  */
8226  __Pyx_TraceLine(1032,0,__PYX_ERR(0, 1032, __pyx_L1_error))
8227  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
8228  if (__pyx_t_2) {
8229  } else {
8230  __pyx_t_1 = __pyx_t_2;
8231  goto __pyx_L4_bool_binop_done;
8232  }
8233  __pyx_t_2 = (__pyx_v_AtA == Py_None);
8234  __pyx_t_3 = (__pyx_t_2 != 0);
8235  __pyx_t_1 = __pyx_t_3;
8236  __pyx_L4_bool_binop_done:;
8237  if (__pyx_t_1) {
8238 
8239  /* "imate/traceinv/_hutchinson_method.pyx":1033
8240  * # Check AtA is not None when AtA is needed
8241  * if gram and (AtA is None):
8242  * if not ((p == 1) and (B is None) and (C is None)): # <<<<<<<<<<<<<<
8243  * raise RuntimeError('"AtA" cannot be None.')
8244  *
8245  */
8246  __Pyx_TraceLine(1033,0,__PYX_ERR(0, 1033, __pyx_L1_error))
8247  __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error)
8248  __Pyx_GOTREF(__pyx_t_4);
8249  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1033, __pyx_L1_error)
8250  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8251  if (__pyx_t_3) {
8252  } else {
8253  __pyx_t_1 = __pyx_t_3;
8254  goto __pyx_L7_bool_binop_done;
8255  }
8256  __pyx_t_3 = (__pyx_v_B == Py_None);
8257  __pyx_t_2 = (__pyx_t_3 != 0);
8258  if (__pyx_t_2) {
8259  } else {
8260  __pyx_t_1 = __pyx_t_2;
8261  goto __pyx_L7_bool_binop_done;
8262  }
8263  __pyx_t_2 = (__pyx_v_C == Py_None);
8264  __pyx_t_3 = (__pyx_t_2 != 0);
8265  __pyx_t_1 = __pyx_t_3;
8266  __pyx_L7_bool_binop_done:;
8267  __pyx_t_3 = ((!__pyx_t_1) != 0);
8268  if (unlikely(__pyx_t_3)) {
8269 
8270  /* "imate/traceinv/_hutchinson_method.pyx":1034
8271  * if gram and (AtA is None):
8272  * if not ((p == 1) and (B is None) and (C is None)):
8273  * raise RuntimeError('"AtA" cannot be None.') # <<<<<<<<<<<<<<
8274  *
8275  * # Multiply operator * B * E
8276  */
8277  __Pyx_TraceLine(1034,0,__PYX_ERR(0, 1034, __pyx_L1_error))
8278  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error)
8279  __Pyx_GOTREF(__pyx_t_4);
8280  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
8281  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8282  __PYX_ERR(0, 1034, __pyx_L1_error)
8283 
8284  /* "imate/traceinv/_hutchinson_method.pyx":1033
8285  * # Check AtA is not None when AtA is needed
8286  * if gram and (AtA is None):
8287  * if not ((p == 1) and (B is None) and (C is None)): # <<<<<<<<<<<<<<
8288  * raise RuntimeError('"AtA" cannot be None.')
8289  *
8290  */
8291  }
8292 
8293  /* "imate/traceinv/_hutchinson_method.pyx":1032
8294  *
8295  * # Check AtA is not None when AtA is needed
8296  * if gram and (AtA is None): # <<<<<<<<<<<<<<
8297  * if not ((p == 1) and (B is None) and (C is None)):
8298  * raise RuntimeError('"AtA" cannot be None.')
8299  */
8300  }
8301 
8302  /* "imate/traceinv/_hutchinson_method.pyx":1037
8303  *
8304  * # Multiply operator * B * E
8305  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E) # <<<<<<<<<<<<<<
8306  *
8307  * # Multiply operator * C * OpE
8308  */
8309  __Pyx_TraceLine(1037,0,__PYX_ERR(0, 1037, __pyx_L1_error))
8310  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
8311  __Pyx_GOTREF(__pyx_t_5);
8312  __pyx_t_6 = NULL;
8313  __pyx_t_7 = 0;
8314  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8315  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8316  if (likely(__pyx_t_6)) {
8317  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8318  __Pyx_INCREF(__pyx_t_6);
8319  __Pyx_INCREF(function);
8320  __Pyx_DECREF_SET(__pyx_t_5, function);
8321  __pyx_t_7 = 1;
8322  }
8323  }
8324  #if CYTHON_FAST_PYCALL
8325  if (PyFunction_Check(__pyx_t_5)) {
8326  PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
8327  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
8328  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8329  __Pyx_GOTREF(__pyx_t_4);
8330  } else
8331  #endif
8332  #if CYTHON_FAST_PYCCALL
8333  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8334  PyObject *__pyx_temp[9] = {__pyx_t_6, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E};
8335  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
8336  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8337  __Pyx_GOTREF(__pyx_t_4);
8338  } else
8339  #endif
8340  {
8341  __pyx_t_8 = PyTuple_New(8+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error)
8342  __Pyx_GOTREF(__pyx_t_8);
8343  if (__pyx_t_6) {
8344  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
8345  }
8346  __Pyx_INCREF(__pyx_v_A);
8347  __Pyx_GIVEREF(__pyx_v_A);
8348  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_A);
8349  __Pyx_INCREF(__pyx_v_AtA);
8350  __Pyx_GIVEREF(__pyx_v_AtA);
8351  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_AtA);
8352  __Pyx_INCREF(__pyx_v_p);
8353  __Pyx_GIVEREF(__pyx_v_p);
8354  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_p);
8355  __Pyx_INCREF(__pyx_v_gram);
8356  __Pyx_GIVEREF(__pyx_v_gram);
8357  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_gram);
8358  __Pyx_INCREF(__pyx_v_assume_matrix);
8359  __Pyx_GIVEREF(__pyx_v_assume_matrix);
8360  PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_v_assume_matrix);
8361  __Pyx_INCREF(__pyx_v_solver_tol);
8362  __Pyx_GIVEREF(__pyx_v_solver_tol);
8363  PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_v_solver_tol);
8364  __Pyx_INCREF(__pyx_v_B);
8365  __Pyx_GIVEREF(__pyx_v_B);
8366  PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_7, __pyx_v_B);
8367  __Pyx_INCREF(__pyx_v_E);
8368  __Pyx_GIVEREF(__pyx_v_E);
8369  PyTuple_SET_ITEM(__pyx_t_8, 7+__pyx_t_7, __pyx_v_E);
8370  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1037, __pyx_L1_error)
8371  __Pyx_GOTREF(__pyx_t_4);
8372  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8373  }
8374  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8375  __pyx_v_OpE = __pyx_t_4;
8376  __pyx_t_4 = 0;
8377 
8378  /* "imate/traceinv/_hutchinson_method.pyx":1040
8379  *
8380  * # Multiply operator * C * OpE
8381  * if C is not None: # <<<<<<<<<<<<<<
8382  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, C, OpE)
8383  *
8384  */
8385  __Pyx_TraceLine(1040,0,__PYX_ERR(0, 1040, __pyx_L1_error))
8386  __pyx_t_3 = (__pyx_v_C != Py_None);
8387  __pyx_t_1 = (__pyx_t_3 != 0);
8388  if (__pyx_t_1) {
8389 
8390  /* "imate/traceinv/_hutchinson_method.pyx":1041
8391  * # Multiply operator * C * OpE
8392  * if C is not None:
8393  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, C, OpE) # <<<<<<<<<<<<<<
8394  *
8395  * # Get c pointer to E
8396  */
8397  __Pyx_TraceLine(1041,0,__PYX_ERR(0, 1041, __pyx_L1_error))
8398  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_operator_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1041, __pyx_L1_error)
8399  __Pyx_GOTREF(__pyx_t_5);
8400  __pyx_t_8 = NULL;
8401  __pyx_t_7 = 0;
8402  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8403  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
8404  if (likely(__pyx_t_8)) {
8405  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8406  __Pyx_INCREF(__pyx_t_8);
8407  __Pyx_INCREF(function);
8408  __Pyx_DECREF_SET(__pyx_t_5, function);
8409  __pyx_t_7 = 1;
8410  }
8411  }
8412  #if CYTHON_FAST_PYCALL
8413  if (PyFunction_Check(__pyx_t_5)) {
8414  PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
8415  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
8416  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8417  __Pyx_GOTREF(__pyx_t_4);
8418  } else
8419  #endif
8420  #if CYTHON_FAST_PYCCALL
8421  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8422  PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_C, __pyx_v_OpE};
8423  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 8+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
8424  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8425  __Pyx_GOTREF(__pyx_t_4);
8426  } else
8427  #endif
8428  {
8429  __pyx_t_6 = PyTuple_New(8+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1041, __pyx_L1_error)
8430  __Pyx_GOTREF(__pyx_t_6);
8431  if (__pyx_t_8) {
8432  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
8433  }
8434  __Pyx_INCREF(__pyx_v_A);
8435  __Pyx_GIVEREF(__pyx_v_A);
8436  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_A);
8437  __Pyx_INCREF(__pyx_v_AtA);
8438  __Pyx_GIVEREF(__pyx_v_AtA);
8439  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_AtA);
8440  __Pyx_INCREF(__pyx_v_p);
8441  __Pyx_GIVEREF(__pyx_v_p);
8442  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_p);
8443  __Pyx_INCREF(__pyx_v_gram);
8444  __Pyx_GIVEREF(__pyx_v_gram);
8445  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_gram);
8446  __Pyx_INCREF(__pyx_v_assume_matrix);
8447  __Pyx_GIVEREF(__pyx_v_assume_matrix);
8448  PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_7, __pyx_v_assume_matrix);
8449  __Pyx_INCREF(__pyx_v_solver_tol);
8450  __Pyx_GIVEREF(__pyx_v_solver_tol);
8451  PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_7, __pyx_v_solver_tol);
8452  __Pyx_INCREF(__pyx_v_C);
8453  __Pyx_GIVEREF(__pyx_v_C);
8454  PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_7, __pyx_v_C);
8455  __Pyx_INCREF(__pyx_v_OpE);
8456  __Pyx_GIVEREF(__pyx_v_OpE);
8457  PyTuple_SET_ITEM(__pyx_t_6, 7+__pyx_t_7, __pyx_v_OpE);
8458  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error)
8459  __Pyx_GOTREF(__pyx_t_4);
8460  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8461  }
8462  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8463  __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_4);
8464  __pyx_t_4 = 0;
8465 
8466  /* "imate/traceinv/_hutchinson_method.pyx":1040
8467  *
8468  * # Multiply operator * C * OpE
8469  * if C is not None: # <<<<<<<<<<<<<<
8470  * OpE = _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, C, OpE)
8471  *
8472  */
8473  }
8474 
8475  /* "imate/traceinv/_hutchinson_method.pyx":1044
8476  *
8477  * # Get c pointer to E
8478  * cdef double[:] memoryview_E = E # <<<<<<<<<<<<<<
8479  * cdef double* cE = &memoryview_E[0]
8480  *
8481  */
8482  __Pyx_TraceLine(1044,0,__PYX_ERR(0, 1044, __pyx_L1_error))
8483  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_E, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1044, __pyx_L1_error)
8484  __pyx_v_memoryview_E = __pyx_t_9;
8485  __pyx_t_9.memview = NULL;
8486  __pyx_t_9.data = NULL;
8487 
8488  /* "imate/traceinv/_hutchinson_method.pyx":1045
8489  * # Get c pointer to E
8490  * cdef double[:] memoryview_E = E
8491  * cdef double* cE = &memoryview_E[0] # <<<<<<<<<<<<<<
8492  *
8493  * # Get c pointer to OpE.
8494  */
8495  __Pyx_TraceLine(1045,0,__PYX_ERR(0, 1045, __pyx_L1_error))
8496  __pyx_t_10 = 0;
8497  __pyx_v_cE = (&(*((double *) ( /* dim=0 */ (__pyx_v_memoryview_E.data + __pyx_t_10 * __pyx_v_memoryview_E.strides[0]) ))));
8498 
8499  /* "imate/traceinv/_hutchinson_method.pyx":1048
8500  *
8501  * # Get c pointer to OpE.
8502  * cdef double[:] memoryview_OpE = OpE # <<<<<<<<<<<<<<
8503  * cdef double* cOpE = &memoryview_OpE[0]
8504  *
8505  */
8506  __Pyx_TraceLine(1048,0,__PYX_ERR(0, 1048, __pyx_L1_error))
8507  __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_OpE, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 1048, __pyx_L1_error)
8508  __pyx_v_memoryview_OpE = __pyx_t_9;
8509  __pyx_t_9.memview = NULL;
8510  __pyx_t_9.data = NULL;
8511 
8512  /* "imate/traceinv/_hutchinson_method.pyx":1049
8513  * # Get c pointer to OpE.
8514  * cdef double[:] memoryview_OpE = OpE
8515  * cdef double* cOpE = &memoryview_OpE[0] # <<<<<<<<<<<<<<
8516  *
8517  * # Inner product of E and OpE
8518  */
8519  __Pyx_TraceLine(1049,0,__PYX_ERR(0, 1049, __pyx_L1_error))
8520  __pyx_t_10 = 0;
8521  __pyx_v_cOpE = (&(*((double *) ( /* dim=0 */ (__pyx_v_memoryview_OpE.data + __pyx_t_10 * __pyx_v_memoryview_OpE.strides[0]) ))));
8522 
8523  /* "imate/traceinv/_hutchinson_method.pyx":1052
8524  *
8525  * # Inner product of E and OpE
8526  * cdef int vector_size = A.shape[0] # <<<<<<<<<<<<<<
8527  * cdef double inner_prod
8528  *
8529  */
8530  __Pyx_TraceLine(1052,0,__PYX_ERR(0, 1052, __pyx_L1_error))
8531  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error)
8532  __Pyx_GOTREF(__pyx_t_4);
8533  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1052, __pyx_L1_error)
8534  __Pyx_GOTREF(__pyx_t_5);
8535  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8536  __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1052, __pyx_L1_error)
8537  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8538  __pyx_v_vector_size = __pyx_t_7;
8539 
8540  /* "imate/traceinv/_hutchinson_method.pyx":1055
8541  * cdef double inner_prod
8542  *
8543  * if gram and (numpy.abs(p) == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
8544  * inner_prod = cVectorOperations[double].inner_product(cOpE, cOpE,
8545  * vector_size)
8546  */
8547  __Pyx_TraceLine(1055,0,__PYX_ERR(0, 1055, __pyx_L1_error))
8548  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error)
8549  if (__pyx_t_3) {
8550  } else {
8551  __pyx_t_1 = __pyx_t_3;
8552  goto __pyx_L12_bool_binop_done;
8553  }
8554  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1055, __pyx_L1_error)
8555  __Pyx_GOTREF(__pyx_t_4);
8556  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error)
8557  __Pyx_GOTREF(__pyx_t_6);
8558  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8559  __pyx_t_4 = NULL;
8560  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8561  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8562  if (likely(__pyx_t_4)) {
8563  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8564  __Pyx_INCREF(__pyx_t_4);
8565  __Pyx_INCREF(function);
8566  __Pyx_DECREF_SET(__pyx_t_6, function);
8567  }
8568  }
8569  __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_p);
8570  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8571  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1055, __pyx_L1_error)
8572  __Pyx_GOTREF(__pyx_t_5);
8573  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8574  __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error)
8575  __Pyx_GOTREF(__pyx_t_6);
8576  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8577  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error)
8578  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8579  if (__pyx_t_3) {
8580  } else {
8581  __pyx_t_1 = __pyx_t_3;
8582  goto __pyx_L12_bool_binop_done;
8583  }
8584  __pyx_t_3 = (__pyx_v_B == Py_None);
8585  __pyx_t_2 = (__pyx_t_3 != 0);
8586  if (__pyx_t_2) {
8587  } else {
8588  __pyx_t_1 = __pyx_t_2;
8589  goto __pyx_L12_bool_binop_done;
8590  }
8591  __pyx_t_2 = (__pyx_v_C == Py_None);
8592  __pyx_t_3 = (__pyx_t_2 != 0);
8593  __pyx_t_1 = __pyx_t_3;
8594  __pyx_L12_bool_binop_done:;
8595  if (__pyx_t_1) {
8596 
8597  /* "imate/traceinv/_hutchinson_method.pyx":1056
8598  *
8599  * if gram and (numpy.abs(p) == 1) and (B is None) and (C is None):
8600  * inner_prod = cVectorOperations[double].inner_product(cOpE, cOpE, # <<<<<<<<<<<<<<
8601  * vector_size)
8602  * else:
8603  */
8604  __Pyx_TraceLine(1056,0,__PYX_ERR(0, 1056, __pyx_L1_error))
8605  __pyx_v_inner_prod = cVectorOperations<double> ::inner_product(__pyx_v_cOpE, __pyx_v_cOpE, __pyx_v_vector_size);
8606 
8607  /* "imate/traceinv/_hutchinson_method.pyx":1055
8608  * cdef double inner_prod
8609  *
8610  * if gram and (numpy.abs(p) == 1) and (B is None) and (C is None): # <<<<<<<<<<<<<<
8611  * inner_prod = cVectorOperations[double].inner_product(cOpE, cOpE,
8612  * vector_size)
8613  */
8614  goto __pyx_L11;
8615  }
8616 
8617  /* "imate/traceinv/_hutchinson_method.pyx":1059
8618  * vector_size)
8619  * else:
8620  * inner_prod = cVectorOperations[double].inner_product(cE, cOpE, # <<<<<<<<<<<<<<
8621  * vector_size)
8622  *
8623  */
8624  __Pyx_TraceLine(1059,0,__PYX_ERR(0, 1059, __pyx_L1_error))
8625  /*else*/ {
8626 
8627  /* "imate/traceinv/_hutchinson_method.pyx":1060
8628  * else:
8629  * inner_prod = cVectorOperations[double].inner_product(cE, cOpE,
8630  * vector_size) # <<<<<<<<<<<<<<
8631  *
8632  * # Hutcinson trace estimate
8633  */
8634  __Pyx_TraceLine(1060,0,__PYX_ERR(0, 1060, __pyx_L1_error))
8635  __pyx_v_inner_prod = cVectorOperations<double> ::inner_product(__pyx_v_cE, __pyx_v_cOpE, __pyx_v_vector_size);
8636  }
8637  __pyx_L11:;
8638 
8639  /* "imate/traceinv/_hutchinson_method.pyx":1063
8640  *
8641  * # Hutcinson trace estimate
8642  * cdef double trace_estimate = vector_size * inner_prod # <<<<<<<<<<<<<<
8643  *
8644  * return trace_estimate
8645  */
8646  __Pyx_TraceLine(1063,0,__PYX_ERR(0, 1063, __pyx_L1_error))
8647  __pyx_v_trace_estimate = (__pyx_v_vector_size * __pyx_v_inner_prod);
8648 
8649  /* "imate/traceinv/_hutchinson_method.pyx":1065
8650  * cdef double trace_estimate = vector_size * inner_prod
8651  *
8652  * return trace_estimate # <<<<<<<<<<<<<<
8653  *
8654  *
8655  */
8656  __Pyx_TraceLine(1065,0,__PYX_ERR(0, 1065, __pyx_L1_error))
8657  __pyx_r = __pyx_v_trace_estimate;
8658  goto __pyx_L0;
8659 
8660  /* "imate/traceinv/_hutchinson_method.pyx":993
8661  * # =================================
8662  *
8663  * cdef double _stochastic_trace_estimator_double( # <<<<<<<<<<<<<<
8664  * A,
8665  * AtA,
8666  */
8667 
8668  /* function exit code */
8669  __pyx_L1_error:;
8670  __Pyx_XDECREF(__pyx_t_4);
8671  __Pyx_XDECREF(__pyx_t_5);
8672  __Pyx_XDECREF(__pyx_t_6);
8673  __Pyx_XDECREF(__pyx_t_8);
8674  __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
8675  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._stochastic_trace_estimator_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
8676  __pyx_r = -1;
8677  __pyx_L0:;
8678  __Pyx_XDECREF(__pyx_v_OpE);
8679  __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_E, 1);
8680  __PYX_XDEC_MEMVIEW(&__pyx_v_memoryview_OpE, 1);
8681  __Pyx_TraceReturn(Py_None, 0);
8682  __Pyx_RefNannyFinishContext();
8683  return __pyx_r;
8684 }
8685 
8686 /* "imate/traceinv/_hutchinson_method.pyx":1072
8687  * # ============
8688  *
8689  * def _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E): # <<<<<<<<<<<<<<
8690  * """
8691  * Computes either of the followings:
8692  */
8693 
8694 /* Python wrapper */
8695 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_7_operator_dot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8696 static char __pyx_doc_5imate_8traceinv_18_hutchinson_method_6_operator_dot[] = "_operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E)\n\n Computes either of the followings:\n\n * Ainv * B * E\n * (Ainv ** p) * B * E\n * AtA * B * E\n * (AtA ** p) * B * E\n ";
8697 static PyMethodDef __pyx_mdef_5imate_8traceinv_18_hutchinson_method_7_operator_dot = {"_operator_dot", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5imate_8traceinv_18_hutchinson_method_7_operator_dot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5imate_8traceinv_18_hutchinson_method_6_operator_dot};
8698 static PyObject *__pyx_pw_5imate_8traceinv_18_hutchinson_method_7_operator_dot(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8699  PyObject *__pyx_v_A = 0;
8700  PyObject *__pyx_v_AtA = 0;
8701  PyObject *__pyx_v_p = 0;
8702  PyObject *__pyx_v_gram = 0;
8703  PyObject *__pyx_v_assume_matrix = 0;
8704  PyObject *__pyx_v_solver_tol = 0;
8705  PyObject *__pyx_v_B = 0;
8706  PyObject *__pyx_v_E = 0;
8707  int __pyx_lineno = 0;
8708  const char *__pyx_filename = NULL;
8709  int __pyx_clineno = 0;
8710  PyObject *__pyx_r = 0;
8711  __Pyx_RefNannyDeclarations
8712  __Pyx_RefNannySetupContext("_operator_dot (wrapper)", 0);
8713  {
8714  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_AtA,&__pyx_n_s_p,&__pyx_n_s_gram,&__pyx_n_s_assume_matrix,&__pyx_n_s_solver_tol,&__pyx_n_s_B,&__pyx_n_s_E,0};
8715  PyObject* values[8] = {0,0,0,0,0,0,0,0};
8716  if (unlikely(__pyx_kwds)) {
8717  Py_ssize_t kw_args;
8718  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8719  switch (pos_args) {
8720  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8721  CYTHON_FALLTHROUGH;
8722  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8723  CYTHON_FALLTHROUGH;
8724  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8725  CYTHON_FALLTHROUGH;
8726  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8727  CYTHON_FALLTHROUGH;
8728  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8729  CYTHON_FALLTHROUGH;
8730  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8731  CYTHON_FALLTHROUGH;
8732  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8733  CYTHON_FALLTHROUGH;
8734  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8735  CYTHON_FALLTHROUGH;
8736  case 0: break;
8737  default: goto __pyx_L5_argtuple_error;
8738  }
8739  kw_args = PyDict_Size(__pyx_kwds);
8740  switch (pos_args) {
8741  case 0:
8742  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
8743  else goto __pyx_L5_argtuple_error;
8744  CYTHON_FALLTHROUGH;
8745  case 1:
8746  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_AtA)) != 0)) kw_args--;
8747  else {
8748  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, 1); __PYX_ERR(0, 1072, __pyx_L3_error)
8749  }
8750  CYTHON_FALLTHROUGH;
8751  case 2:
8752  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
8753  else {
8754  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, 2); __PYX_ERR(0, 1072, __pyx_L3_error)
8755  }
8756  CYTHON_FALLTHROUGH;
8757  case 3:
8758  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gram)) != 0)) kw_args--;
8759  else {
8760  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, 3); __PYX_ERR(0, 1072, __pyx_L3_error)
8761  }
8762  CYTHON_FALLTHROUGH;
8763  case 4:
8764  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_assume_matrix)) != 0)) kw_args--;
8765  else {
8766  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, 4); __PYX_ERR(0, 1072, __pyx_L3_error)
8767  }
8768  CYTHON_FALLTHROUGH;
8769  case 5:
8770  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_solver_tol)) != 0)) kw_args--;
8771  else {
8772  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, 5); __PYX_ERR(0, 1072, __pyx_L3_error)
8773  }
8774  CYTHON_FALLTHROUGH;
8775  case 6:
8776  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_B)) != 0)) kw_args--;
8777  else {
8778  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, 6); __PYX_ERR(0, 1072, __pyx_L3_error)
8779  }
8780  CYTHON_FALLTHROUGH;
8781  case 7:
8782  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_E)) != 0)) kw_args--;
8783  else {
8784  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, 7); __PYX_ERR(0, 1072, __pyx_L3_error)
8785  }
8786  }
8787  if (unlikely(kw_args > 0)) {
8788  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_operator_dot") < 0)) __PYX_ERR(0, 1072, __pyx_L3_error)
8789  }
8790  } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
8791  goto __pyx_L5_argtuple_error;
8792  } else {
8793  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8794  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8795  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8796  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8797  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8798  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8799  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8800  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8801  }
8802  __pyx_v_A = values[0];
8803  __pyx_v_AtA = values[1];
8804  __pyx_v_p = values[2];
8805  __pyx_v_gram = values[3];
8806  __pyx_v_assume_matrix = values[4];
8807  __pyx_v_solver_tol = values[5];
8808  __pyx_v_B = values[6];
8809  __pyx_v_E = values[7];
8810  }
8811  goto __pyx_L4_argument_unpacking_done;
8812  __pyx_L5_argtuple_error:;
8813  __Pyx_RaiseArgtupleInvalid("_operator_dot", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1072, __pyx_L3_error)
8814  __pyx_L3_error:;
8815  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._operator_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
8816  __Pyx_RefNannyFinishContext();
8817  return NULL;
8818  __pyx_L4_argument_unpacking_done:;
8819  __pyx_r = __pyx_pf_5imate_8traceinv_18_hutchinson_method_6_operator_dot(__pyx_self, __pyx_v_A, __pyx_v_AtA, __pyx_v_p, __pyx_v_gram, __pyx_v_assume_matrix, __pyx_v_solver_tol, __pyx_v_B, __pyx_v_E);
8820 
8821  /* function exit code */
8822  __Pyx_RefNannyFinishContext();
8823  return __pyx_r;
8824 }
8825 
8826 static PyObject *__pyx_pf_5imate_8traceinv_18_hutchinson_method_6_operator_dot(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_A, PyObject *__pyx_v_AtA, PyObject *__pyx_v_p, PyObject *__pyx_v_gram, PyObject *__pyx_v_assume_matrix, PyObject *__pyx_v_solver_tol, PyObject *__pyx_v_B, PyObject *__pyx_v_E) {
8827  PyObject *__pyx_v_BE = NULL;
8828  PyObject *__pyx_v_OpE = NULL;
8829  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
8830  CYTHON_UNUSED PyObject *__pyx_v_AinvpE = NULL;
8831  PyObject *__pyx_r = NULL;
8832  __Pyx_TraceDeclarations
8833  __Pyx_RefNannyDeclarations
8834  int __pyx_t_1;
8835  int __pyx_t_2;
8836  PyObject *__pyx_t_3 = NULL;
8837  PyObject *__pyx_t_4 = NULL;
8838  PyObject *__pyx_t_5 = NULL;
8839  PyObject *__pyx_t_6 = NULL;
8840  int __pyx_t_7;
8841  PyObject *__pyx_t_8 = NULL;
8842  Py_ssize_t __pyx_t_9;
8843  PyObject *(*__pyx_t_10)(PyObject *);
8844  int __pyx_lineno = 0;
8845  const char *__pyx_filename = NULL;
8846  int __pyx_clineno = 0;
8847  __Pyx_TraceFrameInit(__pyx_codeobj__7)
8848  __Pyx_RefNannySetupContext("_operator_dot", 0);
8849  __Pyx_TraceCall("_operator_dot", __pyx_f[0], 1072, 0, __PYX_ERR(0, 1072, __pyx_L1_error));
8850 
8851  /* "imate/traceinv/_hutchinson_method.pyx":1083
8852  *
8853  * # Multiply B by E
8854  * if B is not None: # <<<<<<<<<<<<<<
8855  * BE = B @ E
8856  * else:
8857  */
8858  __Pyx_TraceLine(1083,0,__PYX_ERR(0, 1083, __pyx_L1_error))
8859  __pyx_t_1 = (__pyx_v_B != Py_None);
8860  __pyx_t_2 = (__pyx_t_1 != 0);
8861  if (__pyx_t_2) {
8862 
8863  /* "imate/traceinv/_hutchinson_method.pyx":1084
8864  * # Multiply B by E
8865  * if B is not None:
8866  * BE = B @ E # <<<<<<<<<<<<<<
8867  * else:
8868  * # Assume B is identity matrix
8869  */
8870  __Pyx_TraceLine(1084,0,__PYX_ERR(0, 1084, __pyx_L1_error))
8871  __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_B, __pyx_v_E); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
8872  __Pyx_GOTREF(__pyx_t_3);
8873  __pyx_v_BE = __pyx_t_3;
8874  __pyx_t_3 = 0;
8875 
8876  /* "imate/traceinv/_hutchinson_method.pyx":1083
8877  *
8878  * # Multiply B by E
8879  * if B is not None: # <<<<<<<<<<<<<<
8880  * BE = B @ E
8881  * else:
8882  */
8883  goto __pyx_L3;
8884  }
8885 
8886  /* "imate/traceinv/_hutchinson_method.pyx":1087
8887  * else:
8888  * # Assume B is identity matrix
8889  * BE = E # <<<<<<<<<<<<<<
8890  *
8891  * # In the following, OpE is the action of the operator A**(-p) to the
8892  */
8893  __Pyx_TraceLine(1087,0,__PYX_ERR(0, 1087, __pyx_L1_error))
8894  /*else*/ {
8895  __Pyx_INCREF(__pyx_v_E);
8896  __pyx_v_BE = __pyx_v_E;
8897  }
8898  __pyx_L3:;
8899 
8900  /* "imate/traceinv/_hutchinson_method.pyx":1092
8901  * # vector BE. The exponent "p" is the "p" argument which is default
8902  * # to one. Ainv means the inverse of A.
8903  * if p == 0: # <<<<<<<<<<<<<<
8904  * # Ainvp is the identity matrix
8905  * OpE = BE
8906  */
8907  __Pyx_TraceLine(1092,0,__PYX_ERR(0, 1092, __pyx_L1_error))
8908  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1092, __pyx_L1_error)
8909  __Pyx_GOTREF(__pyx_t_3);
8910  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1092, __pyx_L1_error)
8911  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8912  if (__pyx_t_2) {
8913 
8914  /* "imate/traceinv/_hutchinson_method.pyx":1094
8915  * if p == 0:
8916  * # Ainvp is the identity matrix
8917  * OpE = BE # <<<<<<<<<<<<<<
8918  *
8919  * elif p == 1:
8920  */
8921  __Pyx_TraceLine(1094,0,__PYX_ERR(0, 1094, __pyx_L1_error))
8922  __Pyx_INCREF(__pyx_v_BE);
8923  __pyx_v_OpE = __pyx_v_BE;
8924 
8925  /* "imate/traceinv/_hutchinson_method.pyx":1092
8926  * # vector BE. The exponent "p" is the "p" argument which is default
8927  * # to one. Ainv means the inverse of A.
8928  * if p == 0: # <<<<<<<<<<<<<<
8929  * # Ainvp is the identity matrix
8930  * OpE = BE
8931  */
8932  goto __pyx_L4;
8933  }
8934 
8935  /* "imate/traceinv/_hutchinson_method.pyx":1096
8936  * OpE = BE
8937  *
8938  * elif p == 1: # <<<<<<<<<<<<<<
8939  * # Perform inv(A) * BE. This requires GIL
8940  * if gram:
8941  */
8942  __Pyx_TraceLine(1096,0,__PYX_ERR(0, 1096, __pyx_L1_error))
8943  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error)
8944  __Pyx_GOTREF(__pyx_t_3);
8945  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1096, __pyx_L1_error)
8946  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8947  if (__pyx_t_2) {
8948 
8949  /* "imate/traceinv/_hutchinson_method.pyx":1098
8950  * elif p == 1:
8951  * # Perform inv(A) * BE. This requires GIL
8952  * if gram: # <<<<<<<<<<<<<<
8953  * if B is None:
8954  * OpE = linear_solver(A.T, BE, assume_matrix, solver_tol)
8955  */
8956  __Pyx_TraceLine(1098,0,__PYX_ERR(0, 1098, __pyx_L1_error))
8957  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1098, __pyx_L1_error)
8958  if (__pyx_t_2) {
8959 
8960  /* "imate/traceinv/_hutchinson_method.pyx":1099
8961  * # Perform inv(A) * BE. This requires GIL
8962  * if gram:
8963  * if B is None: # <<<<<<<<<<<<<<
8964  * OpE = linear_solver(A.T, BE, assume_matrix, solver_tol)
8965  * else:
8966  */
8967  __Pyx_TraceLine(1099,0,__PYX_ERR(0, 1099, __pyx_L1_error))
8968  __pyx_t_2 = (__pyx_v_B == Py_None);
8969  __pyx_t_1 = (__pyx_t_2 != 0);
8970  if (__pyx_t_1) {
8971 
8972  /* "imate/traceinv/_hutchinson_method.pyx":1100
8973  * if gram:
8974  * if B is None:
8975  * OpE = linear_solver(A.T, BE, assume_matrix, solver_tol) # <<<<<<<<<<<<<<
8976  * else:
8977  * OpE = linear_solver(AtA, BE, assume_matrix, solver_tol)
8978  */
8979  __Pyx_TraceLine(1100,0,__PYX_ERR(0, 1100, __pyx_L1_error))
8980  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_linear_solver); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error)
8981  __Pyx_GOTREF(__pyx_t_4);
8982  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1100, __pyx_L1_error)
8983  __Pyx_GOTREF(__pyx_t_5);
8984  __pyx_t_6 = NULL;
8985  __pyx_t_7 = 0;
8986  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8987  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
8988  if (likely(__pyx_t_6)) {
8989  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8990  __Pyx_INCREF(__pyx_t_6);
8991  __Pyx_INCREF(function);
8992  __Pyx_DECREF_SET(__pyx_t_4, function);
8993  __pyx_t_7 = 1;
8994  }
8995  }
8996  #if CYTHON_FAST_PYCALL
8997  if (PyFunction_Check(__pyx_t_4)) {
8998  PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
8999  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
9000  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9001  __Pyx_GOTREF(__pyx_t_3);
9002  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9003  } else
9004  #endif
9005  #if CYTHON_FAST_PYCCALL
9006  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9007  PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_t_5, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9008  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
9009  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9010  __Pyx_GOTREF(__pyx_t_3);
9011  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9012  } else
9013  #endif
9014  {
9015  __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1100, __pyx_L1_error)
9016  __Pyx_GOTREF(__pyx_t_8);
9017  if (__pyx_t_6) {
9018  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
9019  }
9020  __Pyx_GIVEREF(__pyx_t_5);
9021  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5);
9022  __Pyx_INCREF(__pyx_v_BE);
9023  __Pyx_GIVEREF(__pyx_v_BE);
9024  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_BE);
9025  __Pyx_INCREF(__pyx_v_assume_matrix);
9026  __Pyx_GIVEREF(__pyx_v_assume_matrix);
9027  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_assume_matrix);
9028  __Pyx_INCREF(__pyx_v_solver_tol);
9029  __Pyx_GIVEREF(__pyx_v_solver_tol);
9030  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_solver_tol);
9031  __pyx_t_5 = 0;
9032  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error)
9033  __Pyx_GOTREF(__pyx_t_3);
9034  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9035  }
9036  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9037  __pyx_v_OpE = __pyx_t_3;
9038  __pyx_t_3 = 0;
9039 
9040  /* "imate/traceinv/_hutchinson_method.pyx":1099
9041  * # Perform inv(A) * BE. This requires GIL
9042  * if gram:
9043  * if B is None: # <<<<<<<<<<<<<<
9044  * OpE = linear_solver(A.T, BE, assume_matrix, solver_tol)
9045  * else:
9046  */
9047  goto __pyx_L6;
9048  }
9049 
9050  /* "imate/traceinv/_hutchinson_method.pyx":1102
9051  * OpE = linear_solver(A.T, BE, assume_matrix, solver_tol)
9052  * else:
9053  * OpE = linear_solver(AtA, BE, assume_matrix, solver_tol) # <<<<<<<<<<<<<<
9054  * else:
9055  * OpE = linear_solver(A, BE, assume_matrix, solver_tol)
9056  */
9057  __Pyx_TraceLine(1102,0,__PYX_ERR(0, 1102, __pyx_L1_error))
9058  /*else*/ {
9059  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_linear_solver); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1102, __pyx_L1_error)
9060  __Pyx_GOTREF(__pyx_t_4);
9061  __pyx_t_8 = NULL;
9062  __pyx_t_7 = 0;
9063  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9064  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
9065  if (likely(__pyx_t_8)) {
9066  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9067  __Pyx_INCREF(__pyx_t_8);
9068  __Pyx_INCREF(function);
9069  __Pyx_DECREF_SET(__pyx_t_4, function);
9070  __pyx_t_7 = 1;
9071  }
9072  }
9073  #if CYTHON_FAST_PYCALL
9074  if (PyFunction_Check(__pyx_t_4)) {
9075  PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_AtA, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9076  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error)
9077  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9078  __Pyx_GOTREF(__pyx_t_3);
9079  } else
9080  #endif
9081  #if CYTHON_FAST_PYCCALL
9082  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9083  PyObject *__pyx_temp[5] = {__pyx_t_8, __pyx_v_AtA, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9084  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error)
9085  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9086  __Pyx_GOTREF(__pyx_t_3);
9087  } else
9088  #endif
9089  {
9090  __pyx_t_5 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1102, __pyx_L1_error)
9091  __Pyx_GOTREF(__pyx_t_5);
9092  if (__pyx_t_8) {
9093  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8); __pyx_t_8 = NULL;
9094  }
9095  __Pyx_INCREF(__pyx_v_AtA);
9096  __Pyx_GIVEREF(__pyx_v_AtA);
9097  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_AtA);
9098  __Pyx_INCREF(__pyx_v_BE);
9099  __Pyx_GIVEREF(__pyx_v_BE);
9100  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_BE);
9101  __Pyx_INCREF(__pyx_v_assume_matrix);
9102  __Pyx_GIVEREF(__pyx_v_assume_matrix);
9103  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_assume_matrix);
9104  __Pyx_INCREF(__pyx_v_solver_tol);
9105  __Pyx_GIVEREF(__pyx_v_solver_tol);
9106  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_7, __pyx_v_solver_tol);
9107  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error)
9108  __Pyx_GOTREF(__pyx_t_3);
9109  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9110  }
9111  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9112  __pyx_v_OpE = __pyx_t_3;
9113  __pyx_t_3 = 0;
9114  }
9115  __pyx_L6:;
9116 
9117  /* "imate/traceinv/_hutchinson_method.pyx":1098
9118  * elif p == 1:
9119  * # Perform inv(A) * BE. This requires GIL
9120  * if gram: # <<<<<<<<<<<<<<
9121  * if B is None:
9122  * OpE = linear_solver(A.T, BE, assume_matrix, solver_tol)
9123  */
9124  goto __pyx_L5;
9125  }
9126 
9127  /* "imate/traceinv/_hutchinson_method.pyx":1104
9128  * OpE = linear_solver(AtA, BE, assume_matrix, solver_tol)
9129  * else:
9130  * OpE = linear_solver(A, BE, assume_matrix, solver_tol) # <<<<<<<<<<<<<<
9131  *
9132  * elif p > 1:
9133  */
9134  __Pyx_TraceLine(1104,0,__PYX_ERR(0, 1104, __pyx_L1_error))
9135  /*else*/ {
9136  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_linear_solver); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error)
9137  __Pyx_GOTREF(__pyx_t_4);
9138  __pyx_t_5 = NULL;
9139  __pyx_t_7 = 0;
9140  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9141  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
9142  if (likely(__pyx_t_5)) {
9143  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9144  __Pyx_INCREF(__pyx_t_5);
9145  __Pyx_INCREF(function);
9146  __Pyx_DECREF_SET(__pyx_t_4, function);
9147  __pyx_t_7 = 1;
9148  }
9149  }
9150  #if CYTHON_FAST_PYCALL
9151  if (PyFunction_Check(__pyx_t_4)) {
9152  PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_A, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9153  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error)
9154  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9155  __Pyx_GOTREF(__pyx_t_3);
9156  } else
9157  #endif
9158  #if CYTHON_FAST_PYCCALL
9159  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9160  PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_A, __pyx_v_BE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9161  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error)
9162  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9163  __Pyx_GOTREF(__pyx_t_3);
9164  } else
9165  #endif
9166  {
9167  __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1104, __pyx_L1_error)
9168  __Pyx_GOTREF(__pyx_t_8);
9169  if (__pyx_t_5) {
9170  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
9171  }
9172  __Pyx_INCREF(__pyx_v_A);
9173  __Pyx_GIVEREF(__pyx_v_A);
9174  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_A);
9175  __Pyx_INCREF(__pyx_v_BE);
9176  __Pyx_GIVEREF(__pyx_v_BE);
9177  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_BE);
9178  __Pyx_INCREF(__pyx_v_assume_matrix);
9179  __Pyx_GIVEREF(__pyx_v_assume_matrix);
9180  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_assume_matrix);
9181  __Pyx_INCREF(__pyx_v_solver_tol);
9182  __Pyx_GIVEREF(__pyx_v_solver_tol);
9183  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_solver_tol);
9184  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error)
9185  __Pyx_GOTREF(__pyx_t_3);
9186  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9187  }
9188  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9189  __pyx_v_OpE = __pyx_t_3;
9190  __pyx_t_3 = 0;
9191  }
9192  __pyx_L5:;
9193 
9194  /* "imate/traceinv/_hutchinson_method.pyx":1096
9195  * OpE = BE
9196  *
9197  * elif p == 1: # <<<<<<<<<<<<<<
9198  * # Perform inv(A) * BE. This requires GIL
9199  * if gram:
9200  */
9201  goto __pyx_L4;
9202  }
9203 
9204  /* "imate/traceinv/_hutchinson_method.pyx":1106
9205  * OpE = linear_solver(A, BE, assume_matrix, solver_tol)
9206  *
9207  * elif p > 1: # <<<<<<<<<<<<<<
9208  * # Perform Ainv * Ainv * ... Ainv * BE where Ainv is repeated p times
9209  * # where p is the exponent.
9210  */
9211  __Pyx_TraceLine(1106,0,__PYX_ERR(0, 1106, __pyx_L1_error))
9212  __pyx_t_3 = PyObject_RichCompare(__pyx_v_p, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error)
9213  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1106, __pyx_L1_error)
9214  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9215  if (__pyx_t_1) {
9216 
9217  /* "imate/traceinv/_hutchinson_method.pyx":1109
9218  * # Perform Ainv * Ainv * ... Ainv * BE where Ainv is repeated p times
9219  * # where p is the exponent.
9220  * OpE = BE # <<<<<<<<<<<<<<
9221  *
9222  * if gram:
9223  */
9224  __Pyx_TraceLine(1109,0,__PYX_ERR(0, 1109, __pyx_L1_error))
9225  __Pyx_INCREF(__pyx_v_BE);
9226  __pyx_v_OpE = __pyx_v_BE;
9227 
9228  /* "imate/traceinv/_hutchinson_method.pyx":1111
9229  * OpE = BE
9230  *
9231  * if gram: # <<<<<<<<<<<<<<
9232  * for i in range(p):
9233  * OpE = linear_solver(AtA, OpE, assume_matrix, solver_tol)
9234  */
9235  __Pyx_TraceLine(1111,0,__PYX_ERR(0, 1111, __pyx_L1_error))
9236  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1111, __pyx_L1_error)
9237  if (__pyx_t_1) {
9238 
9239  /* "imate/traceinv/_hutchinson_method.pyx":1112
9240  *
9241  * if gram:
9242  * for i in range(p): # <<<<<<<<<<<<<<
9243  * OpE = linear_solver(AtA, OpE, assume_matrix, solver_tol)
9244  * else:
9245  */
9246  __Pyx_TraceLine(1112,0,__PYX_ERR(0, 1112, __pyx_L1_error))
9247  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
9248  __Pyx_GOTREF(__pyx_t_3);
9249  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
9250  __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
9251  __pyx_t_10 = NULL;
9252  } else {
9253  __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1112, __pyx_L1_error)
9254  __Pyx_GOTREF(__pyx_t_4);
9255  __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1112, __pyx_L1_error)
9256  }
9257  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9258  for (;;) {
9259  if (likely(!__pyx_t_10)) {
9260  if (likely(PyList_CheckExact(__pyx_t_4))) {
9261  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
9262  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9263  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1112, __pyx_L1_error)
9264  #else
9265  __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
9266  __Pyx_GOTREF(__pyx_t_3);
9267  #endif
9268  } else {
9269  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
9270  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9271  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1112, __pyx_L1_error)
9272  #else
9273  __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
9274  __Pyx_GOTREF(__pyx_t_3);
9275  #endif
9276  }
9277  } else {
9278  __pyx_t_3 = __pyx_t_10(__pyx_t_4);
9279  if (unlikely(!__pyx_t_3)) {
9280  PyObject* exc_type = PyErr_Occurred();
9281  if (exc_type) {
9282  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9283  else __PYX_ERR(0, 1112, __pyx_L1_error)
9284  }
9285  break;
9286  }
9287  __Pyx_GOTREF(__pyx_t_3);
9288  }
9289  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
9290  __pyx_t_3 = 0;
9291 
9292  /* "imate/traceinv/_hutchinson_method.pyx":1113
9293  * if gram:
9294  * for i in range(p):
9295  * OpE = linear_solver(AtA, OpE, assume_matrix, solver_tol) # <<<<<<<<<<<<<<
9296  * else:
9297  * for i in range(p):
9298  */
9299  __Pyx_TraceLine(1113,0,__PYX_ERR(0, 1113, __pyx_L1_error))
9300  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_linear_solver); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1113, __pyx_L1_error)
9301  __Pyx_GOTREF(__pyx_t_8);
9302  __pyx_t_5 = NULL;
9303  __pyx_t_7 = 0;
9304  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9305  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
9306  if (likely(__pyx_t_5)) {
9307  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
9308  __Pyx_INCREF(__pyx_t_5);
9309  __Pyx_INCREF(function);
9310  __Pyx_DECREF_SET(__pyx_t_8, function);
9311  __pyx_t_7 = 1;
9312  }
9313  }
9314  #if CYTHON_FAST_PYCALL
9315  if (PyFunction_Check(__pyx_t_8)) {
9316  PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_AtA, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9317  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
9318  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9319  __Pyx_GOTREF(__pyx_t_3);
9320  } else
9321  #endif
9322  #if CYTHON_FAST_PYCCALL
9323  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
9324  PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_AtA, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9325  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
9326  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9327  __Pyx_GOTREF(__pyx_t_3);
9328  } else
9329  #endif
9330  {
9331  __pyx_t_6 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1113, __pyx_L1_error)
9332  __Pyx_GOTREF(__pyx_t_6);
9333  if (__pyx_t_5) {
9334  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
9335  }
9336  __Pyx_INCREF(__pyx_v_AtA);
9337  __Pyx_GIVEREF(__pyx_v_AtA);
9338  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_AtA);
9339  __Pyx_INCREF(__pyx_v_OpE);
9340  __Pyx_GIVEREF(__pyx_v_OpE);
9341  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_OpE);
9342  __Pyx_INCREF(__pyx_v_assume_matrix);
9343  __Pyx_GIVEREF(__pyx_v_assume_matrix);
9344  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_v_assume_matrix);
9345  __Pyx_INCREF(__pyx_v_solver_tol);
9346  __Pyx_GIVEREF(__pyx_v_solver_tol);
9347  PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_7, __pyx_v_solver_tol);
9348  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
9349  __Pyx_GOTREF(__pyx_t_3);
9350  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9351  }
9352  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9353  __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_3);
9354  __pyx_t_3 = 0;
9355 
9356  /* "imate/traceinv/_hutchinson_method.pyx":1112
9357  *
9358  * if gram:
9359  * for i in range(p): # <<<<<<<<<<<<<<
9360  * OpE = linear_solver(AtA, OpE, assume_matrix, solver_tol)
9361  * else:
9362  */
9363  __Pyx_TraceLine(1112,0,__PYX_ERR(0, 1112, __pyx_L1_error))
9364  }
9365  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9366 
9367  /* "imate/traceinv/_hutchinson_method.pyx":1111
9368  * OpE = BE
9369  *
9370  * if gram: # <<<<<<<<<<<<<<
9371  * for i in range(p):
9372  * OpE = linear_solver(AtA, OpE, assume_matrix, solver_tol)
9373  */
9374  goto __pyx_L7;
9375  }
9376 
9377  /* "imate/traceinv/_hutchinson_method.pyx":1115
9378  * OpE = linear_solver(AtA, OpE, assume_matrix, solver_tol)
9379  * else:
9380  * for i in range(p): # <<<<<<<<<<<<<<
9381  * OpE = linear_solver(A, OpE, assume_matrix, solver_tol)
9382  *
9383  */
9384  __Pyx_TraceLine(1115,0,__PYX_ERR(0, 1115, __pyx_L1_error))
9385  /*else*/ {
9386  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
9387  __Pyx_GOTREF(__pyx_t_4);
9388  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
9389  __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
9390  __pyx_t_10 = NULL;
9391  } else {
9392  __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1115, __pyx_L1_error)
9393  __Pyx_GOTREF(__pyx_t_3);
9394  __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1115, __pyx_L1_error)
9395  }
9396  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9397  for (;;) {
9398  if (likely(!__pyx_t_10)) {
9399  if (likely(PyList_CheckExact(__pyx_t_3))) {
9400  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
9401  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9402  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
9403  #else
9404  __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
9405  __Pyx_GOTREF(__pyx_t_4);
9406  #endif
9407  } else {
9408  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9409  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9410  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1115, __pyx_L1_error)
9411  #else
9412  __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error)
9413  __Pyx_GOTREF(__pyx_t_4);
9414  #endif
9415  }
9416  } else {
9417  __pyx_t_4 = __pyx_t_10(__pyx_t_3);
9418  if (unlikely(!__pyx_t_4)) {
9419  PyObject* exc_type = PyErr_Occurred();
9420  if (exc_type) {
9421  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9422  else __PYX_ERR(0, 1115, __pyx_L1_error)
9423  }
9424  break;
9425  }
9426  __Pyx_GOTREF(__pyx_t_4);
9427  }
9428  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
9429  __pyx_t_4 = 0;
9430 
9431  /* "imate/traceinv/_hutchinson_method.pyx":1116
9432  * else:
9433  * for i in range(p):
9434  * OpE = linear_solver(A, OpE, assume_matrix, solver_tol) # <<<<<<<<<<<<<<
9435  *
9436  * elif p == -1:
9437  */
9438  __Pyx_TraceLine(1116,0,__PYX_ERR(0, 1116, __pyx_L1_error))
9439  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_linear_solver); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1116, __pyx_L1_error)
9440  __Pyx_GOTREF(__pyx_t_8);
9441  __pyx_t_6 = NULL;
9442  __pyx_t_7 = 0;
9443  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9444  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
9445  if (likely(__pyx_t_6)) {
9446  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
9447  __Pyx_INCREF(__pyx_t_6);
9448  __Pyx_INCREF(function);
9449  __Pyx_DECREF_SET(__pyx_t_8, function);
9450  __pyx_t_7 = 1;
9451  }
9452  }
9453  #if CYTHON_FAST_PYCALL
9454  if (PyFunction_Check(__pyx_t_8)) {
9455  PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_A, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9456  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
9457  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9458  __Pyx_GOTREF(__pyx_t_4);
9459  } else
9460  #endif
9461  #if CYTHON_FAST_PYCCALL
9462  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
9463  PyObject *__pyx_temp[5] = {__pyx_t_6, __pyx_v_A, __pyx_v_OpE, __pyx_v_assume_matrix, __pyx_v_solver_tol};
9464  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
9465  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9466  __Pyx_GOTREF(__pyx_t_4);
9467  } else
9468  #endif
9469  {
9470  __pyx_t_5 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1116, __pyx_L1_error)
9471  __Pyx_GOTREF(__pyx_t_5);
9472  if (__pyx_t_6) {
9473  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
9474  }
9475  __Pyx_INCREF(__pyx_v_A);
9476  __Pyx_GIVEREF(__pyx_v_A);
9477  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_7, __pyx_v_A);
9478  __Pyx_INCREF(__pyx_v_OpE);
9479  __Pyx_GIVEREF(__pyx_v_OpE);
9480  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_v_OpE);
9481  __Pyx_INCREF(__pyx_v_assume_matrix);
9482  __Pyx_GIVEREF(__pyx_v_assume_matrix);
9483  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_7, __pyx_v_assume_matrix);
9484  __Pyx_INCREF(__pyx_v_solver_tol);
9485  __Pyx_GIVEREF(__pyx_v_solver_tol);
9486  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_7, __pyx_v_solver_tol);
9487  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error)
9488  __Pyx_GOTREF(__pyx_t_4);
9489  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9490  }
9491  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9492  __Pyx_DECREF_SET(__pyx_v_OpE, __pyx_t_4);
9493  __pyx_t_4 = 0;
9494 
9495  /* "imate/traceinv/_hutchinson_method.pyx":1115
9496  * OpE = linear_solver(AtA, OpE, assume_matrix, solver_tol)
9497  * else:
9498  * for i in range(p): # <<<<<<<<<<<<<<
9499  * OpE = linear_solver(A, OpE, assume_matrix, solver_tol)
9500  *
9501  */
9502  __Pyx_TraceLine(1115,0,__PYX_ERR(0, 1115, __pyx_L1_error))
9503  }
9504  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9505  }
9506  __pyx_L7:;
9507 
9508  /* "imate/traceinv/_hutchinson_method.pyx":1106
9509  * OpE = linear_solver(A, BE, assume_matrix, solver_tol)
9510  *
9511  * elif p > 1: # <<<<<<<<<<<<<<
9512  * # Perform Ainv * Ainv * ... Ainv * BE where Ainv is repeated p times
9513  * # where p is the exponent.
9514  */
9515  goto __pyx_L4;
9516  }
9517 
9518  /* "imate/traceinv/_hutchinson_method.pyx":1118
9519  * OpE = linear_solver(A, OpE, assume_matrix, solver_tol)
9520  *
9521  * elif p == -1: # <<<<<<<<<<<<<<
9522  * # Performing Ainv**(-1) BE, where Ainv**(-1) it A itself.
9523  * OpE = A @ BE
9524  */
9525  __Pyx_TraceLine(1118,0,__PYX_ERR(0, 1118, __pyx_L1_error))
9526  __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_p, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1118, __pyx_L1_error)
9527  __Pyx_GOTREF(__pyx_t_3);
9528  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1118, __pyx_L1_error)
9529  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9530  if (__pyx_t_1) {
9531 
9532  /* "imate/traceinv/_hutchinson_method.pyx":1120
9533  * elif p == -1:
9534  * # Performing Ainv**(-1) BE, where Ainv**(-1) it A itself.
9535  * OpE = A @ BE # <<<<<<<<<<<<<<
9536  *
9537  * elif p < -1:
9538  */
9539  __Pyx_TraceLine(1120,0,__PYX_ERR(0, 1120, __pyx_L1_error))
9540  __pyx_t_3 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_A, __pyx_v_BE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1120, __pyx_L1_error)
9541  __Pyx_GOTREF(__pyx_t_3);
9542  __pyx_v_OpE = __pyx_t_3;
9543  __pyx_t_3 = 0;
9544 
9545  /* "imate/traceinv/_hutchinson_method.pyx":1118
9546  * OpE = linear_solver(A, OpE, assume_matrix, solver_tol)
9547  *
9548  * elif p == -1: # <<<<<<<<<<<<<<
9549  * # Performing Ainv**(-1) BE, where Ainv**(-1) it A itself.
9550  * OpE = A @ BE
9551  */
9552  goto __pyx_L4;
9553  }
9554 
9555  /* "imate/traceinv/_hutchinson_method.pyx":1122
9556  * OpE = A @ BE
9557  *
9558  * elif p < -1: # <<<<<<<<<<<<<<
9559  * # Performing Ainv**(-p) * BE where Ainv**(-p) = A**p.
9560  * AinvpE = BE
9561  */
9562  __Pyx_TraceLine(1122,0,__PYX_ERR(0, 1122, __pyx_L1_error))
9563  __pyx_t_3 = PyObject_RichCompare(__pyx_v_p, __pyx_int_neg_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error)
9564  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1122, __pyx_L1_error)
9565  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9566  if (__pyx_t_1) {
9567 
9568  /* "imate/traceinv/_hutchinson_method.pyx":1124
9569  * elif p < -1:
9570  * # Performing Ainv**(-p) * BE where Ainv**(-p) = A**p.
9571  * AinvpE = BE # <<<<<<<<<<<<<<
9572  * if gram:
9573  * for i in range(numpy.abs(p)):
9574  */
9575  __Pyx_TraceLine(1124,0,__PYX_ERR(0, 1124, __pyx_L1_error))
9576  __Pyx_INCREF(__pyx_v_BE);
9577  __pyx_v_AinvpE = __pyx_v_BE;
9578 
9579  /* "imate/traceinv/_hutchinson_method.pyx":1125
9580  * # Performing Ainv**(-p) * BE where Ainv**(-p) = A**p.
9581  * AinvpE = BE
9582  * if gram: # <<<<<<<<<<<<<<
9583  * for i in range(numpy.abs(p)):
9584  * OpE = AtA @ OpE
9585  */
9586  __Pyx_TraceLine(1125,0,__PYX_ERR(0, 1125, __pyx_L1_error))
9587  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_gram); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1125, __pyx_L1_error)
9588  if (__pyx_t_1) {
9589 
9590  /* "imate/traceinv/_hutchinson_method.pyx":1126
9591  * AinvpE = BE
9592  * if gram:
9593  * for i in range(numpy.abs(p)): # <<<<<<<<<<<<<<
9594  * OpE = AtA @ OpE
9595  * else:
9596  */
9597  __Pyx_TraceLine(1126,0,__PYX_ERR(0, 1126, __pyx_L1_error))
9598  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error)
9599  __Pyx_GOTREF(__pyx_t_4);
9600  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9601  __Pyx_GOTREF(__pyx_t_8);
9602  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9603  __pyx_t_4 = NULL;
9604  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9605  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
9606  if (likely(__pyx_t_4)) {
9607  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
9608  __Pyx_INCREF(__pyx_t_4);
9609  __Pyx_INCREF(function);
9610  __Pyx_DECREF_SET(__pyx_t_8, function);
9611  }
9612  }
9613  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_p);
9614  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9615  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error)
9616  __Pyx_GOTREF(__pyx_t_3);
9617  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9618  __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9619  __Pyx_GOTREF(__pyx_t_8);
9620  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9621  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
9622  __pyx_t_3 = __pyx_t_8; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
9623  __pyx_t_10 = NULL;
9624  } else {
9625  __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error)
9626  __Pyx_GOTREF(__pyx_t_3);
9627  __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1126, __pyx_L1_error)
9628  }
9629  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9630  for (;;) {
9631  if (likely(!__pyx_t_10)) {
9632  if (likely(PyList_CheckExact(__pyx_t_3))) {
9633  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
9634  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9635  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1126, __pyx_L1_error)
9636  #else
9637  __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9638  __Pyx_GOTREF(__pyx_t_8);
9639  #endif
9640  } else {
9641  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9642  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9643  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1126, __pyx_L1_error)
9644  #else
9645  __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1126, __pyx_L1_error)
9646  __Pyx_GOTREF(__pyx_t_8);
9647  #endif
9648  }
9649  } else {
9650  __pyx_t_8 = __pyx_t_10(__pyx_t_3);
9651  if (unlikely(!__pyx_t_8)) {
9652  PyObject* exc_type = PyErr_Occurred();
9653  if (exc_type) {
9654  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9655  else __PYX_ERR(0, 1126, __pyx_L1_error)
9656  }
9657  break;
9658  }
9659  __Pyx_GOTREF(__pyx_t_8);
9660  }
9661  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
9662  __pyx_t_8 = 0;
9663 
9664  /* "imate/traceinv/_hutchinson_method.pyx":1127
9665  * if gram:
9666  * for i in range(numpy.abs(p)):
9667  * OpE = AtA @ OpE # <<<<<<<<<<<<<<
9668  * else:
9669  * for i in range(numpy.abs(p)):
9670  */
9671  __Pyx_TraceLine(1127,0,__PYX_ERR(0, 1127, __pyx_L1_error))
9672  if (unlikely(!__pyx_v_OpE)) { __Pyx_RaiseUnboundLocalError("OpE"); __PYX_ERR(0, 1127, __pyx_L1_error) }
9673  __pyx_t_8 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_AtA, __pyx_v_OpE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1127, __pyx_L1_error)
9674  __Pyx_GOTREF(__pyx_t_8);
9675  __Pyx_XDECREF_SET(__pyx_v_OpE, __pyx_t_8);
9676  __pyx_t_8 = 0;
9677 
9678  /* "imate/traceinv/_hutchinson_method.pyx":1126
9679  * AinvpE = BE
9680  * if gram:
9681  * for i in range(numpy.abs(p)): # <<<<<<<<<<<<<<
9682  * OpE = AtA @ OpE
9683  * else:
9684  */
9685  __Pyx_TraceLine(1126,0,__PYX_ERR(0, 1126, __pyx_L1_error))
9686  }
9687  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9688 
9689  /* "imate/traceinv/_hutchinson_method.pyx":1125
9690  * # Performing Ainv**(-p) * BE where Ainv**(-p) = A**p.
9691  * AinvpE = BE
9692  * if gram: # <<<<<<<<<<<<<<
9693  * for i in range(numpy.abs(p)):
9694  * OpE = AtA @ OpE
9695  */
9696  goto __pyx_L12;
9697  }
9698 
9699  /* "imate/traceinv/_hutchinson_method.pyx":1129
9700  * OpE = AtA @ OpE
9701  * else:
9702  * for i in range(numpy.abs(p)): # <<<<<<<<<<<<<<
9703  * OpE = A @ OpE
9704  *
9705  */
9706  __Pyx_TraceLine(1129,0,__PYX_ERR(0, 1129, __pyx_L1_error))
9707  /*else*/ {
9708  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1129, __pyx_L1_error)
9709  __Pyx_GOTREF(__pyx_t_8);
9710  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_abs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9711  __Pyx_GOTREF(__pyx_t_4);
9712  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9713  __pyx_t_8 = NULL;
9714  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9715  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
9716  if (likely(__pyx_t_8)) {
9717  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9718  __Pyx_INCREF(__pyx_t_8);
9719  __Pyx_INCREF(function);
9720  __Pyx_DECREF_SET(__pyx_t_4, function);
9721  }
9722  }
9723  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_v_p) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_p);
9724  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9725  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
9726  __Pyx_GOTREF(__pyx_t_3);
9727  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9728  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9729  __Pyx_GOTREF(__pyx_t_4);
9730  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9731  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
9732  __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_9 = 0;
9733  __pyx_t_10 = NULL;
9734  } else {
9735  __pyx_t_9 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error)
9736  __Pyx_GOTREF(__pyx_t_3);
9737  __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1129, __pyx_L1_error)
9738  }
9739  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9740  for (;;) {
9741  if (likely(!__pyx_t_10)) {
9742  if (likely(PyList_CheckExact(__pyx_t_3))) {
9743  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_3)) break;
9744  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9745  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
9746  #else
9747  __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9748  __Pyx_GOTREF(__pyx_t_4);
9749  #endif
9750  } else {
9751  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9752  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9753  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1129, __pyx_L1_error)
9754  #else
9755  __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error)
9756  __Pyx_GOTREF(__pyx_t_4);
9757  #endif
9758  }
9759  } else {
9760  __pyx_t_4 = __pyx_t_10(__pyx_t_3);
9761  if (unlikely(!__pyx_t_4)) {
9762  PyObject* exc_type = PyErr_Occurred();
9763  if (exc_type) {
9764  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9765  else __PYX_ERR(0, 1129, __pyx_L1_error)
9766  }
9767  break;
9768  }
9769  __Pyx_GOTREF(__pyx_t_4);
9770  }
9771  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
9772  __pyx_t_4 = 0;
9773 
9774  /* "imate/traceinv/_hutchinson_method.pyx":1130
9775  * else:
9776  * for i in range(numpy.abs(p)):
9777  * OpE = A @ OpE # <<<<<<<<<<<<<<
9778  *
9779  * return OpE
9780  */
9781  __Pyx_TraceLine(1130,0,__PYX_ERR(0, 1130, __pyx_L1_error))
9782  if (unlikely(!__pyx_v_OpE)) { __Pyx_RaiseUnboundLocalError("OpE"); __PYX_ERR(0, 1130, __pyx_L1_error) }
9783  __pyx_t_4 = __Pyx_PyNumber_MatrixMultiply(__pyx_v_A, __pyx_v_OpE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1130, __pyx_L1_error)
9784  __Pyx_GOTREF(__pyx_t_4);
9785  __Pyx_XDECREF_SET(__pyx_v_OpE, __pyx_t_4);
9786  __pyx_t_4 = 0;
9787 
9788  /* "imate/traceinv/_hutchinson_method.pyx":1129
9789  * OpE = AtA @ OpE
9790  * else:
9791  * for i in range(numpy.abs(p)): # <<<<<<<<<<<<<<
9792  * OpE = A @ OpE
9793  *
9794  */
9795  __Pyx_TraceLine(1129,0,__PYX_ERR(0, 1129, __pyx_L1_error))
9796  }
9797  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9798  }
9799  __pyx_L12:;
9800 
9801  /* "imate/traceinv/_hutchinson_method.pyx":1122
9802  * OpE = A @ BE
9803  *
9804  * elif p < -1: # <<<<<<<<<<<<<<
9805  * # Performing Ainv**(-p) * BE where Ainv**(-p) = A**p.
9806  * AinvpE = BE
9807  */
9808  }
9809  __pyx_L4:;
9810 
9811  /* "imate/traceinv/_hutchinson_method.pyx":1132
9812  * OpE = A @ OpE
9813  *
9814  * return OpE # <<<<<<<<<<<<<<
9815  */
9816  __Pyx_TraceLine(1132,0,__PYX_ERR(0, 1132, __pyx_L1_error))
9817  __Pyx_XDECREF(__pyx_r);
9818  if (unlikely(!__pyx_v_OpE)) { __Pyx_RaiseUnboundLocalError("OpE"); __PYX_ERR(0, 1132, __pyx_L1_error) }
9819  __Pyx_INCREF(__pyx_v_OpE);
9820  __pyx_r = __pyx_v_OpE;
9821  goto __pyx_L0;
9822 
9823  /* "imate/traceinv/_hutchinson_method.pyx":1072
9824  * # ============
9825  *
9826  * def _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E): # <<<<<<<<<<<<<<
9827  * """
9828  * Computes either of the followings:
9829  */
9830 
9831  /* function exit code */
9832  __pyx_L1_error:;
9833  __Pyx_XDECREF(__pyx_t_3);
9834  __Pyx_XDECREF(__pyx_t_4);
9835  __Pyx_XDECREF(__pyx_t_5);
9836  __Pyx_XDECREF(__pyx_t_6);
9837  __Pyx_XDECREF(__pyx_t_8);
9838  __Pyx_AddTraceback("imate.traceinv._hutchinson_method._operator_dot", __pyx_clineno, __pyx_lineno, __pyx_filename);
9839  __pyx_r = NULL;
9840  __pyx_L0:;
9841  __Pyx_XDECREF(__pyx_v_BE);
9842  __Pyx_XDECREF(__pyx_v_OpE);
9843  __Pyx_XDECREF(__pyx_v_i);
9844  __Pyx_XDECREF(__pyx_v_AinvpE);
9845  __Pyx_XGIVEREF(__pyx_r);
9846  __Pyx_TraceReturn(__pyx_r, 0);
9847  __Pyx_RefNannyFinishContext();
9848  return __pyx_r;
9849 }
9850 
9851 /* "View.MemoryView":123
9852  * cdef bint dtype_is_object
9853  *
9854  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9855  * mode="c", bint allocate_buffer=True):
9856  *
9857  */
9858 
9859 /* Python wrapper */
9860 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9861 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9862  PyObject *__pyx_v_shape = 0;
9863  Py_ssize_t __pyx_v_itemsize;
9864  PyObject *__pyx_v_format = 0;
9865  PyObject *__pyx_v_mode = 0;
9866  int __pyx_v_allocate_buffer;
9867  int __pyx_lineno = 0;
9868  const char *__pyx_filename = NULL;
9869  int __pyx_clineno = 0;
9870  int __pyx_r;
9871  __Pyx_RefNannyDeclarations
9872  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9873  {
9874  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
9875  PyObject* values[5] = {0,0,0,0,0};
9876  values[3] = ((PyObject *)__pyx_n_s_c);
9877  if (unlikely(__pyx_kwds)) {
9878  Py_ssize_t kw_args;
9879  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9880  switch (pos_args) {
9881  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9882  CYTHON_FALLTHROUGH;
9883  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9884  CYTHON_FALLTHROUGH;
9885  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9886  CYTHON_FALLTHROUGH;
9887  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9888  CYTHON_FALLTHROUGH;
9889  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9890  CYTHON_FALLTHROUGH;
9891  case 0: break;
9892  default: goto __pyx_L5_argtuple_error;
9893  }
9894  kw_args = PyDict_Size(__pyx_kwds);
9895  switch (pos_args) {
9896  case 0:
9897  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
9898  else goto __pyx_L5_argtuple_error;
9899  CYTHON_FALLTHROUGH;
9900  case 1:
9901  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
9902  else {
9903  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 123, __pyx_L3_error)
9904  }
9905  CYTHON_FALLTHROUGH;
9906  case 2:
9907  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
9908  else {
9909  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 123, __pyx_L3_error)
9910  }
9911  CYTHON_FALLTHROUGH;
9912  case 3:
9913  if (kw_args > 0) {
9914  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
9915  if (value) { values[3] = value; kw_args--; }
9916  }
9917  CYTHON_FALLTHROUGH;
9918  case 4:
9919  if (kw_args > 0) {
9920  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
9921  if (value) { values[4] = value; kw_args--; }
9922  }
9923  }
9924  if (unlikely(kw_args > 0)) {
9925  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
9926  }
9927  } else {
9928  switch (PyTuple_GET_SIZE(__pyx_args)) {
9929  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9930  CYTHON_FALLTHROUGH;
9931  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9932  CYTHON_FALLTHROUGH;
9933  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9934  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9935  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9936  break;
9937  default: goto __pyx_L5_argtuple_error;
9938  }
9939  }
9940  __pyx_v_shape = ((PyObject*)values[0]);
9941  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
9942  __pyx_v_format = values[2];
9943  __pyx_v_mode = values[3];
9944  if (values[4]) {
9945  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
9946  } else {
9947 
9948  /* "View.MemoryView":124
9949  *
9950  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
9951  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
9952  *
9953  * cdef int idx
9954  */
9955  __pyx_v_allocate_buffer = ((int)1);
9956  }
9957  }
9958  goto __pyx_L4_argument_unpacking_done;
9959  __pyx_L5_argtuple_error:;
9960  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
9961  __pyx_L3_error:;
9962  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9963  __Pyx_RefNannyFinishContext();
9964  return -1;
9965  __pyx_L4_argument_unpacking_done:;
9966  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 123, __pyx_L1_error)
9967  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
9968  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 123, __pyx_L1_error)
9969  }
9970  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
9971 
9972  /* "View.MemoryView":123
9973  * cdef bint dtype_is_object
9974  *
9975  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
9976  * mode="c", bint allocate_buffer=True):
9977  *
9978  */
9979 
9980  /* function exit code */
9981  goto __pyx_L0;
9982  __pyx_L1_error:;
9983  __pyx_r = -1;
9984  __pyx_L0:;
9985  __Pyx_RefNannyFinishContext();
9986  return __pyx_r;
9987 }
9988 
9989 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
9990  int __pyx_v_idx;
9991  Py_ssize_t __pyx_v_i;
9992  Py_ssize_t __pyx_v_dim;
9993  PyObject **__pyx_v_p;
9994  char __pyx_v_order;
9995  int __pyx_r;
9996  __Pyx_TraceDeclarations
9997  __Pyx_RefNannyDeclarations
9998  Py_ssize_t __pyx_t_1;
9999  int __pyx_t_2;
10000  PyObject *__pyx_t_3 = NULL;
10001  int __pyx_t_4;
10002  PyObject *__pyx_t_5 = NULL;
10003  PyObject *__pyx_t_6 = NULL;
10004  char *__pyx_t_7;
10005  int __pyx_t_8;
10006  Py_ssize_t __pyx_t_9;
10007  PyObject *__pyx_t_10 = NULL;
10008  Py_ssize_t __pyx_t_11;
10009  int __pyx_lineno = 0;
10010  const char *__pyx_filename = NULL;
10011  int __pyx_clineno = 0;
10012  __Pyx_RefNannySetupContext("__cinit__", 0);
10013  __Pyx_TraceCall("__cinit__", __pyx_f[1], 123, 0, __PYX_ERR(1, 123, __pyx_L1_error));
10014  __Pyx_INCREF(__pyx_v_format);
10015 
10016  /* "View.MemoryView":130
10017  * cdef PyObject **p
10018  *
10019  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
10020  * self.itemsize = itemsize
10021  *
10022  */
10023  __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
10024  if (unlikely(__pyx_v_shape == Py_None)) {
10025  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
10026  __PYX_ERR(1, 130, __pyx_L1_error)
10027  }
10028  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 130, __pyx_L1_error)
10029  __pyx_v_self->ndim = ((int)__pyx_t_1);
10030 
10031  /* "View.MemoryView":131
10032  *
10033  * self.ndim = <int> len(shape)
10034  * self.itemsize = itemsize # <<<<<<<<<<<<<<
10035  *
10036  * if not self.ndim:
10037  */
10038  __Pyx_TraceLine(131,0,__PYX_ERR(1, 131, __pyx_L1_error))
10039  __pyx_v_self->itemsize = __pyx_v_itemsize;
10040 
10041  /* "View.MemoryView":133
10042  * self.itemsize = itemsize
10043  *
10044  * if not self.ndim: # <<<<<<<<<<<<<<
10045  * raise ValueError("Empty shape tuple for cython.array")
10046  *
10047  */
10048  __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
10049  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
10050  if (unlikely(__pyx_t_2)) {
10051 
10052  /* "View.MemoryView":134
10053  *
10054  * if not self.ndim:
10055  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
10056  *
10057  * if itemsize <= 0:
10058  */
10059  __Pyx_TraceLine(134,0,__PYX_ERR(1, 134, __pyx_L1_error))
10060  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __pyx_L1_error)
10061  __Pyx_GOTREF(__pyx_t_3);
10062  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10063  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10064  __PYX_ERR(1, 134, __pyx_L1_error)
10065 
10066  /* "View.MemoryView":133
10067  * self.itemsize = itemsize
10068  *
10069  * if not self.ndim: # <<<<<<<<<<<<<<
10070  * raise ValueError("Empty shape tuple for cython.array")
10071  *
10072  */
10073  }
10074 
10075  /* "View.MemoryView":136
10076  * raise ValueError("Empty shape tuple for cython.array")
10077  *
10078  * if itemsize <= 0: # <<<<<<<<<<<<<<
10079  * raise ValueError("itemsize <= 0 for cython.array")
10080  *
10081  */
10082  __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
10083  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
10084  if (unlikely(__pyx_t_2)) {
10085 
10086  /* "View.MemoryView":137
10087  *
10088  * if itemsize <= 0:
10089  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
10090  *
10091  * if not isinstance(format, bytes):
10092  */
10093  __Pyx_TraceLine(137,0,__PYX_ERR(1, 137, __pyx_L1_error))
10094  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __pyx_L1_error)
10095  __Pyx_GOTREF(__pyx_t_3);
10096  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10097  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10098  __PYX_ERR(1, 137, __pyx_L1_error)
10099 
10100  /* "View.MemoryView":136
10101  * raise ValueError("Empty shape tuple for cython.array")
10102  *
10103  * if itemsize <= 0: # <<<<<<<<<<<<<<
10104  * raise ValueError("itemsize <= 0 for cython.array")
10105  *
10106  */
10107  }
10108 
10109  /* "View.MemoryView":139
10110  * raise ValueError("itemsize <= 0 for cython.array")
10111  *
10112  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
10113  * format = format.encode('ASCII')
10114  * self._format = format # keep a reference to the byte string
10115  */
10116  __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
10117  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
10118  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
10119  if (__pyx_t_4) {
10120 
10121  /* "View.MemoryView":140
10122  *
10123  * if not isinstance(format, bytes):
10124  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
10125  * self._format = format # keep a reference to the byte string
10126  * self.format = self._format
10127  */
10128  __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
10129  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 140, __pyx_L1_error)
10130  __Pyx_GOTREF(__pyx_t_5);
10131  __pyx_t_6 = NULL;
10132  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10133  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
10134  if (likely(__pyx_t_6)) {
10135  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10136  __Pyx_INCREF(__pyx_t_6);
10137  __Pyx_INCREF(function);
10138  __Pyx_DECREF_SET(__pyx_t_5, function);
10139  }
10140  }
10141  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
10142  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10143  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 140, __pyx_L1_error)
10144  __Pyx_GOTREF(__pyx_t_3);
10145  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10146  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
10147  __pyx_t_3 = 0;
10148 
10149  /* "View.MemoryView":139
10150  * raise ValueError("itemsize <= 0 for cython.array")
10151  *
10152  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
10153  * format = format.encode('ASCII')
10154  * self._format = format # keep a reference to the byte string
10155  */
10156  }
10157 
10158  /* "View.MemoryView":141
10159  * if not isinstance(format, bytes):
10160  * format = format.encode('ASCII')
10161  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
10162  * self.format = self._format
10163  *
10164  */
10165  __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
10166  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 141, __pyx_L1_error)
10167  __pyx_t_3 = __pyx_v_format;
10168  __Pyx_INCREF(__pyx_t_3);
10169  __Pyx_GIVEREF(__pyx_t_3);
10170  __Pyx_GOTREF(__pyx_v_self->_format);
10171  __Pyx_DECREF(__pyx_v_self->_format);
10172  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
10173  __pyx_t_3 = 0;
10174 
10175  /* "View.MemoryView":142
10176  * format = format.encode('ASCII')
10177  * self._format = format # keep a reference to the byte string
10178  * self.format = self._format # <<<<<<<<<<<<<<
10179  *
10180  *
10181  */
10182  __Pyx_TraceLine(142,0,__PYX_ERR(1, 142, __pyx_L1_error))
10183  if (unlikely(__pyx_v_self->_format == Py_None)) {
10184  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
10185  __PYX_ERR(1, 142, __pyx_L1_error)
10186  }
10187  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 142, __pyx_L1_error)
10188  __pyx_v_self->format = __pyx_t_7;
10189 
10190  /* "View.MemoryView":145
10191  *
10192  *
10193  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
10194  * self._strides = self._shape + self.ndim
10195  *
10196  */
10197  __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
10198  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
10199 
10200  /* "View.MemoryView":146
10201  *
10202  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
10203  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
10204  *
10205  * if not self._shape:
10206  */
10207  __Pyx_TraceLine(146,0,__PYX_ERR(1, 146, __pyx_L1_error))
10208  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
10209 
10210  /* "View.MemoryView":148
10211  * self._strides = self._shape + self.ndim
10212  *
10213  * if not self._shape: # <<<<<<<<<<<<<<
10214  * raise MemoryError("unable to allocate shape and strides.")
10215  *
10216  */
10217  __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
10218  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
10219  if (unlikely(__pyx_t_4)) {
10220 
10221  /* "View.MemoryView":149
10222  *
10223  * if not self._shape:
10224  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
10225  *
10226  *
10227  */
10228  __Pyx_TraceLine(149,0,__PYX_ERR(1, 149, __pyx_L1_error))
10229  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
10230  __Pyx_GOTREF(__pyx_t_3);
10231  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10232  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10233  __PYX_ERR(1, 149, __pyx_L1_error)
10234 
10235  /* "View.MemoryView":148
10236  * self._strides = self._shape + self.ndim
10237  *
10238  * if not self._shape: # <<<<<<<<<<<<<<
10239  * raise MemoryError("unable to allocate shape and strides.")
10240  *
10241  */
10242  }
10243 
10244  /* "View.MemoryView":152
10245  *
10246  *
10247  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
10248  * if dim <= 0:
10249  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
10250  */
10251  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
10252  __pyx_t_8 = 0;
10253  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
10254  for (;;) {
10255  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
10256  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10257  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 152, __pyx_L1_error)
10258  #else
10259  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 152, __pyx_L1_error)
10260  __Pyx_GOTREF(__pyx_t_5);
10261  #endif
10262  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 152, __pyx_L1_error)
10263  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10264  __pyx_v_dim = __pyx_t_9;
10265  __pyx_v_idx = __pyx_t_8;
10266  __pyx_t_8 = (__pyx_t_8 + 1);
10267 
10268  /* "View.MemoryView":153
10269  *
10270  * for idx, dim in enumerate(shape):
10271  * if dim <= 0: # <<<<<<<<<<<<<<
10272  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
10273  * self._shape[idx] = dim
10274  */
10275  __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
10276  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
10277  if (unlikely(__pyx_t_4)) {
10278 
10279  /* "View.MemoryView":154
10280  * for idx, dim in enumerate(shape):
10281  * if dim <= 0:
10282  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
10283  * self._shape[idx] = dim
10284  *
10285  */
10286  __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
10287  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
10288  __Pyx_GOTREF(__pyx_t_5);
10289  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
10290  __Pyx_GOTREF(__pyx_t_6);
10291  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
10292  __Pyx_GOTREF(__pyx_t_10);
10293  __Pyx_GIVEREF(__pyx_t_5);
10294  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
10295  __Pyx_GIVEREF(__pyx_t_6);
10296  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
10297  __pyx_t_5 = 0;
10298  __pyx_t_6 = 0;
10299  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 154, __pyx_L1_error)
10300  __Pyx_GOTREF(__pyx_t_6);
10301  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10302  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 154, __pyx_L1_error)
10303  __Pyx_GOTREF(__pyx_t_10);
10304  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10305  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
10306  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10307  __PYX_ERR(1, 154, __pyx_L1_error)
10308 
10309  /* "View.MemoryView":153
10310  *
10311  * for idx, dim in enumerate(shape):
10312  * if dim <= 0: # <<<<<<<<<<<<<<
10313  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
10314  * self._shape[idx] = dim
10315  */
10316  }
10317 
10318  /* "View.MemoryView":155
10319  * if dim <= 0:
10320  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
10321  * self._shape[idx] = dim # <<<<<<<<<<<<<<
10322  *
10323  * cdef char order
10324  */
10325  __Pyx_TraceLine(155,0,__PYX_ERR(1, 155, __pyx_L1_error))
10326  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
10327 
10328  /* "View.MemoryView":152
10329  *
10330  *
10331  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
10332  * if dim <= 0:
10333  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
10334  */
10335  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
10336  }
10337  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10338 
10339  /* "View.MemoryView":158
10340  *
10341  * cdef char order
10342  * if mode == 'fortran': # <<<<<<<<<<<<<<
10343  * order = b'F'
10344  * self.mode = u'fortran'
10345  */
10346  __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
10347  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
10348  if (__pyx_t_4) {
10349 
10350  /* "View.MemoryView":159
10351  * cdef char order
10352  * if mode == 'fortran':
10353  * order = b'F' # <<<<<<<<<<<<<<
10354  * self.mode = u'fortran'
10355  * elif mode == 'c':
10356  */
10357  __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
10358  __pyx_v_order = 'F';
10359 
10360  /* "View.MemoryView":160
10361  * if mode == 'fortran':
10362  * order = b'F'
10363  * self.mode = u'fortran' # <<<<<<<<<<<<<<
10364  * elif mode == 'c':
10365  * order = b'C'
10366  */
10367  __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
10368  __Pyx_INCREF(__pyx_n_u_fortran);
10369  __Pyx_GIVEREF(__pyx_n_u_fortran);
10370  __Pyx_GOTREF(__pyx_v_self->mode);
10371  __Pyx_DECREF(__pyx_v_self->mode);
10372  __pyx_v_self->mode = __pyx_n_u_fortran;
10373 
10374  /* "View.MemoryView":158
10375  *
10376  * cdef char order
10377  * if mode == 'fortran': # <<<<<<<<<<<<<<
10378  * order = b'F'
10379  * self.mode = u'fortran'
10380  */
10381  goto __pyx_L10;
10382  }
10383 
10384  /* "View.MemoryView":161
10385  * order = b'F'
10386  * self.mode = u'fortran'
10387  * elif mode == 'c': # <<<<<<<<<<<<<<
10388  * order = b'C'
10389  * self.mode = u'c'
10390  */
10391  __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
10392  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 161, __pyx_L1_error)
10393  if (likely(__pyx_t_4)) {
10394 
10395  /* "View.MemoryView":162
10396  * self.mode = u'fortran'
10397  * elif mode == 'c':
10398  * order = b'C' # <<<<<<<<<<<<<<
10399  * self.mode = u'c'
10400  * else:
10401  */
10402  __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
10403  __pyx_v_order = 'C';
10404 
10405  /* "View.MemoryView":163
10406  * elif mode == 'c':
10407  * order = b'C'
10408  * self.mode = u'c' # <<<<<<<<<<<<<<
10409  * else:
10410  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
10411  */
10412  __Pyx_TraceLine(163,0,__PYX_ERR(1, 163, __pyx_L1_error))
10413  __Pyx_INCREF(__pyx_n_u_c);
10414  __Pyx_GIVEREF(__pyx_n_u_c);
10415  __Pyx_GOTREF(__pyx_v_self->mode);
10416  __Pyx_DECREF(__pyx_v_self->mode);
10417  __pyx_v_self->mode = __pyx_n_u_c;
10418 
10419  /* "View.MemoryView":161
10420  * order = b'F'
10421  * self.mode = u'fortran'
10422  * elif mode == 'c': # <<<<<<<<<<<<<<
10423  * order = b'C'
10424  * self.mode = u'c'
10425  */
10426  goto __pyx_L10;
10427  }
10428 
10429  /* "View.MemoryView":165
10430  * self.mode = u'c'
10431  * else:
10432  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
10433  *
10434  * self.len = fill_contig_strides_array(self._shape, self._strides,
10435  */
10436  __Pyx_TraceLine(165,0,__PYX_ERR(1, 165, __pyx_L1_error))
10437  /*else*/ {
10438  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 165, __pyx_L1_error)
10439  __Pyx_GOTREF(__pyx_t_3);
10440  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 165, __pyx_L1_error)
10441  __Pyx_GOTREF(__pyx_t_10);
10442  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10443  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
10444  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10445  __PYX_ERR(1, 165, __pyx_L1_error)
10446  }
10447  __pyx_L10:;
10448 
10449  /* "View.MemoryView":167
10450  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
10451  *
10452  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
10453  * itemsize, self.ndim, order)
10454  *
10455  */
10456  __Pyx_TraceLine(167,0,__PYX_ERR(1, 167, __pyx_L1_error))
10457  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
10458 
10459  /* "View.MemoryView":170
10460  * itemsize, self.ndim, order)
10461  *
10462  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
10463  * self.dtype_is_object = format == b'O'
10464  * if allocate_buffer:
10465  */
10466  __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
10467  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
10468 
10469  /* "View.MemoryView":171
10470  *
10471  * self.free_data = allocate_buffer
10472  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
10473  * if allocate_buffer:
10474  *
10475  */
10476  __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
10477  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 171, __pyx_L1_error)
10478  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
10479  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10480  __pyx_v_self->dtype_is_object = __pyx_t_4;
10481 
10482  /* "View.MemoryView":172
10483  * self.free_data = allocate_buffer
10484  * self.dtype_is_object = format == b'O'
10485  * if allocate_buffer: # <<<<<<<<<<<<<<
10486  *
10487  *
10488  */
10489  __Pyx_TraceLine(172,0,__PYX_ERR(1, 172, __pyx_L1_error))
10490  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
10491  if (__pyx_t_4) {
10492 
10493  /* "View.MemoryView":175
10494  *
10495  *
10496  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
10497  * if not self.data:
10498  * raise MemoryError("unable to allocate array data.")
10499  */
10500  __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
10501  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
10502 
10503  /* "View.MemoryView":176
10504  *
10505  * self.data = <char *>malloc(self.len)
10506  * if not self.data: # <<<<<<<<<<<<<<
10507  * raise MemoryError("unable to allocate array data.")
10508  *
10509  */
10510  __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
10511  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
10512  if (unlikely(__pyx_t_4)) {
10513 
10514  /* "View.MemoryView":177
10515  * self.data = <char *>malloc(self.len)
10516  * if not self.data:
10517  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
10518  *
10519  * if self.dtype_is_object:
10520  */
10521  __Pyx_TraceLine(177,0,__PYX_ERR(1, 177, __pyx_L1_error))
10522  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 177, __pyx_L1_error)
10523  __Pyx_GOTREF(__pyx_t_10);
10524  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
10525  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10526  __PYX_ERR(1, 177, __pyx_L1_error)
10527 
10528  /* "View.MemoryView":176
10529  *
10530  * self.data = <char *>malloc(self.len)
10531  * if not self.data: # <<<<<<<<<<<<<<
10532  * raise MemoryError("unable to allocate array data.")
10533  *
10534  */
10535  }
10536 
10537  /* "View.MemoryView":179
10538  * raise MemoryError("unable to allocate array data.")
10539  *
10540  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10541  * p = <PyObject **> self.data
10542  * for i in range(self.len / itemsize):
10543  */
10544  __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
10545  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
10546  if (__pyx_t_4) {
10547 
10548  /* "View.MemoryView":180
10549  *
10550  * if self.dtype_is_object:
10551  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
10552  * for i in range(self.len / itemsize):
10553  * p[i] = Py_None
10554  */
10555  __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
10556  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
10557 
10558  /* "View.MemoryView":181
10559  * if self.dtype_is_object:
10560  * p = <PyObject **> self.data
10561  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
10562  * p[i] = Py_None
10563  * Py_INCREF(Py_None)
10564  */
10565  __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
10566  if (unlikely(__pyx_v_itemsize == 0)) {
10567  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
10568  __PYX_ERR(1, 181, __pyx_L1_error)
10569  }
10570  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
10571  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
10572  __PYX_ERR(1, 181, __pyx_L1_error)
10573  }
10574  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
10575  __pyx_t_9 = __pyx_t_1;
10576  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
10577  __pyx_v_i = __pyx_t_11;
10578 
10579  /* "View.MemoryView":182
10580  * p = <PyObject **> self.data
10581  * for i in range(self.len / itemsize):
10582  * p[i] = Py_None # <<<<<<<<<<<<<<
10583  * Py_INCREF(Py_None)
10584  *
10585  */
10586  __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
10587  (__pyx_v_p[__pyx_v_i]) = Py_None;
10588 
10589  /* "View.MemoryView":183
10590  * for i in range(self.len / itemsize):
10591  * p[i] = Py_None
10592  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10593  *
10594  * @cname('getbuffer')
10595  */
10596  __Pyx_TraceLine(183,0,__PYX_ERR(1, 183, __pyx_L1_error))
10597  Py_INCREF(Py_None);
10598  }
10599 
10600  /* "View.MemoryView":179
10601  * raise MemoryError("unable to allocate array data.")
10602  *
10603  * if self.dtype_is_object: # <<<<<<<<<<<<<<
10604  * p = <PyObject **> self.data
10605  * for i in range(self.len / itemsize):
10606  */
10607  }
10608 
10609  /* "View.MemoryView":172
10610  * self.free_data = allocate_buffer
10611  * self.dtype_is_object = format == b'O'
10612  * if allocate_buffer: # <<<<<<<<<<<<<<
10613  *
10614  *
10615  */
10616  }
10617 
10618  /* "View.MemoryView":123
10619  * cdef bint dtype_is_object
10620  *
10621  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
10622  * mode="c", bint allocate_buffer=True):
10623  *
10624  */
10625 
10626  /* function exit code */
10627  __pyx_r = 0;
10628  goto __pyx_L0;
10629  __pyx_L1_error:;
10630  __Pyx_XDECREF(__pyx_t_3);
10631  __Pyx_XDECREF(__pyx_t_5);
10632  __Pyx_XDECREF(__pyx_t_6);
10633  __Pyx_XDECREF(__pyx_t_10);
10634  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10635  __pyx_r = -1;
10636  __pyx_L0:;
10637  __Pyx_XDECREF(__pyx_v_format);
10638  __Pyx_TraceReturn(Py_None, 0);
10639  __Pyx_RefNannyFinishContext();
10640  return __pyx_r;
10641 }
10642 
10643 /* "View.MemoryView":186
10644  *
10645  * @cname('getbuffer')
10646  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
10647  * cdef int bufmode = -1
10648  * if self.mode == u"c":
10649  */
10650 
10651 /* Python wrapper */
10652 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10653 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10654  int __pyx_r;
10655  __Pyx_RefNannyDeclarations
10656  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10657  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10658 
10659  /* function exit code */
10660  __Pyx_RefNannyFinishContext();
10661  return __pyx_r;
10662 }
10663 
10664 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10665  int __pyx_v_bufmode;
10666  int __pyx_r;
10667  __Pyx_TraceDeclarations
10668  __Pyx_RefNannyDeclarations
10669  int __pyx_t_1;
10670  int __pyx_t_2;
10671  PyObject *__pyx_t_3 = NULL;
10672  char *__pyx_t_4;
10673  Py_ssize_t __pyx_t_5;
10674  int __pyx_t_6;
10675  Py_ssize_t *__pyx_t_7;
10676  int __pyx_lineno = 0;
10677  const char *__pyx_filename = NULL;
10678  int __pyx_clineno = 0;
10679  if (__pyx_v_info == NULL) {
10680  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10681  return -1;
10682  }
10683  __Pyx_RefNannySetupContext("__getbuffer__", 0);
10684  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10685  __Pyx_GIVEREF(__pyx_v_info->obj);
10686  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 186, 0, __PYX_ERR(1, 186, __pyx_L1_error));
10687 
10688  /* "View.MemoryView":187
10689  * @cname('getbuffer')
10690  * def __getbuffer__(self, Py_buffer *info, int flags):
10691  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
10692  * if self.mode == u"c":
10693  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10694  */
10695  __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
10696  __pyx_v_bufmode = -1;
10697 
10698  /* "View.MemoryView":188
10699  * def __getbuffer__(self, Py_buffer *info, int flags):
10700  * cdef int bufmode = -1
10701  * if self.mode == u"c": # <<<<<<<<<<<<<<
10702  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10703  * elif self.mode == u"fortran":
10704  */
10705  __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
10706  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 188, __pyx_L1_error)
10707  __pyx_t_2 = (__pyx_t_1 != 0);
10708  if (__pyx_t_2) {
10709 
10710  /* "View.MemoryView":189
10711  * cdef int bufmode = -1
10712  * if self.mode == u"c":
10713  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
10714  * elif self.mode == u"fortran":
10715  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10716  */
10717  __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
10718  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10719 
10720  /* "View.MemoryView":188
10721  * def __getbuffer__(self, Py_buffer *info, int flags):
10722  * cdef int bufmode = -1
10723  * if self.mode == u"c": # <<<<<<<<<<<<<<
10724  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10725  * elif self.mode == u"fortran":
10726  */
10727  goto __pyx_L3;
10728  }
10729 
10730  /* "View.MemoryView":190
10731  * if self.mode == u"c":
10732  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10733  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
10734  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10735  * if not (flags & bufmode):
10736  */
10737  __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
10738  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 190, __pyx_L1_error)
10739  __pyx_t_1 = (__pyx_t_2 != 0);
10740  if (__pyx_t_1) {
10741 
10742  /* "View.MemoryView":191
10743  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10744  * elif self.mode == u"fortran":
10745  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
10746  * if not (flags & bufmode):
10747  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10748  */
10749  __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
10750  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
10751 
10752  /* "View.MemoryView":190
10753  * if self.mode == u"c":
10754  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10755  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
10756  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10757  * if not (flags & bufmode):
10758  */
10759  }
10760  __pyx_L3:;
10761 
10762  /* "View.MemoryView":192
10763  * elif self.mode == u"fortran":
10764  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10765  * if not (flags & bufmode): # <<<<<<<<<<<<<<
10766  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10767  * info.buf = self.data
10768  */
10769  __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
10770  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
10771  if (unlikely(__pyx_t_1)) {
10772 
10773  /* "View.MemoryView":193
10774  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10775  * if not (flags & bufmode):
10776  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
10777  * info.buf = self.data
10778  * info.len = self.len
10779  */
10780  __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
10781  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
10782  __Pyx_GOTREF(__pyx_t_3);
10783  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
10784  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10785  __PYX_ERR(1, 193, __pyx_L1_error)
10786 
10787  /* "View.MemoryView":192
10788  * elif self.mode == u"fortran":
10789  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
10790  * if not (flags & bufmode): # <<<<<<<<<<<<<<
10791  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10792  * info.buf = self.data
10793  */
10794  }
10795 
10796  /* "View.MemoryView":194
10797  * if not (flags & bufmode):
10798  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10799  * info.buf = self.data # <<<<<<<<<<<<<<
10800  * info.len = self.len
10801  * info.ndim = self.ndim
10802  */
10803  __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
10804  __pyx_t_4 = __pyx_v_self->data;
10805  __pyx_v_info->buf = __pyx_t_4;
10806 
10807  /* "View.MemoryView":195
10808  * raise ValueError("Can only create a buffer that is contiguous in memory.")
10809  * info.buf = self.data
10810  * info.len = self.len # <<<<<<<<<<<<<<
10811  * info.ndim = self.ndim
10812  * info.shape = self._shape
10813  */
10814  __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
10815  __pyx_t_5 = __pyx_v_self->len;
10816  __pyx_v_info->len = __pyx_t_5;
10817 
10818  /* "View.MemoryView":196
10819  * info.buf = self.data
10820  * info.len = self.len
10821  * info.ndim = self.ndim # <<<<<<<<<<<<<<
10822  * info.shape = self._shape
10823  * info.strides = self._strides
10824  */
10825  __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
10826  __pyx_t_6 = __pyx_v_self->ndim;
10827  __pyx_v_info->ndim = __pyx_t_6;
10828 
10829  /* "View.MemoryView":197
10830  * info.len = self.len
10831  * info.ndim = self.ndim
10832  * info.shape = self._shape # <<<<<<<<<<<<<<
10833  * info.strides = self._strides
10834  * info.suboffsets = NULL
10835  */
10836  __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
10837  __pyx_t_7 = __pyx_v_self->_shape;
10838  __pyx_v_info->shape = __pyx_t_7;
10839 
10840  /* "View.MemoryView":198
10841  * info.ndim = self.ndim
10842  * info.shape = self._shape
10843  * info.strides = self._strides # <<<<<<<<<<<<<<
10844  * info.suboffsets = NULL
10845  * info.itemsize = self.itemsize
10846  */
10847  __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
10848  __pyx_t_7 = __pyx_v_self->_strides;
10849  __pyx_v_info->strides = __pyx_t_7;
10850 
10851  /* "View.MemoryView":199
10852  * info.shape = self._shape
10853  * info.strides = self._strides
10854  * info.suboffsets = NULL # <<<<<<<<<<<<<<
10855  * info.itemsize = self.itemsize
10856  * info.readonly = 0
10857  */
10858  __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
10859  __pyx_v_info->suboffsets = NULL;
10860 
10861  /* "View.MemoryView":200
10862  * info.strides = self._strides
10863  * info.suboffsets = NULL
10864  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
10865  * info.readonly = 0
10866  *
10867  */
10868  __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
10869  __pyx_t_5 = __pyx_v_self->itemsize;
10870  __pyx_v_info->itemsize = __pyx_t_5;
10871 
10872  /* "View.MemoryView":201
10873  * info.suboffsets = NULL
10874  * info.itemsize = self.itemsize
10875  * info.readonly = 0 # <<<<<<<<<<<<<<
10876  *
10877  * if flags & PyBUF_FORMAT:
10878  */
10879  __Pyx_TraceLine(201,0,__PYX_ERR(1, 201, __pyx_L1_error))
10880  __pyx_v_info->readonly = 0;
10881 
10882  /* "View.MemoryView":203
10883  * info.readonly = 0
10884  *
10885  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10886  * info.format = self.format
10887  * else:
10888  */
10889  __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
10890  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10891  if (__pyx_t_1) {
10892 
10893  /* "View.MemoryView":204
10894  *
10895  * if flags & PyBUF_FORMAT:
10896  * info.format = self.format # <<<<<<<<<<<<<<
10897  * else:
10898  * info.format = NULL
10899  */
10900  __Pyx_TraceLine(204,0,__PYX_ERR(1, 204, __pyx_L1_error))
10901  __pyx_t_4 = __pyx_v_self->format;
10902  __pyx_v_info->format = __pyx_t_4;
10903 
10904  /* "View.MemoryView":203
10905  * info.readonly = 0
10906  *
10907  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10908  * info.format = self.format
10909  * else:
10910  */
10911  goto __pyx_L5;
10912  }
10913 
10914  /* "View.MemoryView":206
10915  * info.format = self.format
10916  * else:
10917  * info.format = NULL # <<<<<<<<<<<<<<
10918  *
10919  * info.obj = self
10920  */
10921  __Pyx_TraceLine(206,0,__PYX_ERR(1, 206, __pyx_L1_error))
10922  /*else*/ {
10923  __pyx_v_info->format = NULL;
10924  }
10925  __pyx_L5:;
10926 
10927  /* "View.MemoryView":208
10928  * info.format = NULL
10929  *
10930  * info.obj = self # <<<<<<<<<<<<<<
10931  *
10932  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10933  */
10934  __Pyx_TraceLine(208,0,__PYX_ERR(1, 208, __pyx_L1_error))
10935  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10936  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
10937  __Pyx_GOTREF(__pyx_v_info->obj);
10938  __Pyx_DECREF(__pyx_v_info->obj);
10939  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10940 
10941  /* "View.MemoryView":186
10942  *
10943  * @cname('getbuffer')
10944  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
10945  * cdef int bufmode = -1
10946  * if self.mode == u"c":
10947  */
10948 
10949  /* function exit code */
10950  __pyx_r = 0;
10951  goto __pyx_L0;
10952  __pyx_L1_error:;
10953  __Pyx_XDECREF(__pyx_t_3);
10954  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10955  __pyx_r = -1;
10956  if (__pyx_v_info->obj != NULL) {
10957  __Pyx_GOTREF(__pyx_v_info->obj);
10958  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10959  }
10960  goto __pyx_L2;
10961  __pyx_L0:;
10962  if (__pyx_v_info->obj == Py_None) {
10963  __Pyx_GOTREF(__pyx_v_info->obj);
10964  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10965  }
10966  __pyx_L2:;
10967  __Pyx_TraceReturn(Py_None, 0);
10968  __Pyx_RefNannyFinishContext();
10969  return __pyx_r;
10970 }
10971 
10972 /* "View.MemoryView":212
10973  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
10974  *
10975  * def __dealloc__(array self): # <<<<<<<<<<<<<<
10976  * if self.callback_free_data != NULL:
10977  * self.callback_free_data(self.data)
10978  */
10979 
10980 /* Python wrapper */
10981 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
10982 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
10983  __Pyx_RefNannyDeclarations
10984  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10985  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
10986 
10987  /* function exit code */
10988  __Pyx_RefNannyFinishContext();
10989 }
10990 
10991 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
10992  __Pyx_TraceDeclarations
10993  __Pyx_RefNannyDeclarations
10994  int __pyx_t_1;
10995  int __pyx_lineno = 0;
10996  const char *__pyx_filename = NULL;
10997  int __pyx_clineno = 0;
10998  __Pyx_RefNannySetupContext("__dealloc__", 0);
10999  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 212, 0, __PYX_ERR(1, 212, __pyx_L1_error));
11000 
11001  /* "View.MemoryView":213
11002  *
11003  * def __dealloc__(array self):
11004  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
11005  * self.callback_free_data(self.data)
11006  * elif self.free_data:
11007  */
11008  __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
11009  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
11010  if (__pyx_t_1) {
11011 
11012  /* "View.MemoryView":214
11013  * def __dealloc__(array self):
11014  * if self.callback_free_data != NULL:
11015  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
11016  * elif self.free_data:
11017  * if self.dtype_is_object:
11018  */
11019  __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
11020  __pyx_v_self->callback_free_data(__pyx_v_self->data);
11021 
11022  /* "View.MemoryView":213
11023  *
11024  * def __dealloc__(array self):
11025  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
11026  * self.callback_free_data(self.data)
11027  * elif self.free_data:
11028  */
11029  goto __pyx_L3;
11030  }
11031 
11032  /* "View.MemoryView":215
11033  * if self.callback_free_data != NULL:
11034  * self.callback_free_data(self.data)
11035  * elif self.free_data: # <<<<<<<<<<<<<<
11036  * if self.dtype_is_object:
11037  * refcount_objects_in_slice(self.data, self._shape,
11038  */
11039  __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
11040  __pyx_t_1 = (__pyx_v_self->free_data != 0);
11041  if (__pyx_t_1) {
11042 
11043  /* "View.MemoryView":216
11044  * self.callback_free_data(self.data)
11045  * elif self.free_data:
11046  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11047  * refcount_objects_in_slice(self.data, self._shape,
11048  * self._strides, self.ndim, False)
11049  */
11050  __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
11051  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
11052  if (__pyx_t_1) {
11053 
11054  /* "View.MemoryView":217
11055  * elif self.free_data:
11056  * if self.dtype_is_object:
11057  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
11058  * self._strides, self.ndim, False)
11059  * free(self.data)
11060  */
11061  __Pyx_TraceLine(217,0,__PYX_ERR(1, 217, __pyx_L1_error))
11062  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
11063 
11064  /* "View.MemoryView":216
11065  * self.callback_free_data(self.data)
11066  * elif self.free_data:
11067  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11068  * refcount_objects_in_slice(self.data, self._shape,
11069  * self._strides, self.ndim, False)
11070  */
11071  }
11072 
11073  /* "View.MemoryView":219
11074  * refcount_objects_in_slice(self.data, self._shape,
11075  * self._strides, self.ndim, False)
11076  * free(self.data) # <<<<<<<<<<<<<<
11077  * PyObject_Free(self._shape)
11078  *
11079  */
11080  __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
11081  free(__pyx_v_self->data);
11082 
11083  /* "View.MemoryView":215
11084  * if self.callback_free_data != NULL:
11085  * self.callback_free_data(self.data)
11086  * elif self.free_data: # <<<<<<<<<<<<<<
11087  * if self.dtype_is_object:
11088  * refcount_objects_in_slice(self.data, self._shape,
11089  */
11090  }
11091  __pyx_L3:;
11092 
11093  /* "View.MemoryView":220
11094  * self._strides, self.ndim, False)
11095  * free(self.data)
11096  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
11097  *
11098  * @property
11099  */
11100  __Pyx_TraceLine(220,0,__PYX_ERR(1, 220, __pyx_L1_error))
11101  PyObject_Free(__pyx_v_self->_shape);
11102 
11103  /* "View.MemoryView":212
11104  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
11105  *
11106  * def __dealloc__(array self): # <<<<<<<<<<<<<<
11107  * if self.callback_free_data != NULL:
11108  * self.callback_free_data(self.data)
11109  */
11110 
11111  /* function exit code */
11112  goto __pyx_L0;
11113  __pyx_L1_error:;
11114  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11115  __pyx_L0:;
11116  __Pyx_TraceReturn(Py_None, 0);
11117  __Pyx_RefNannyFinishContext();
11118 }
11119 
11120 /* "View.MemoryView":223
11121  *
11122  * @property
11123  * def memview(self): # <<<<<<<<<<<<<<
11124  * return self.get_memview()
11125  *
11126  */
11127 
11128 /* Python wrapper */
11129 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
11130 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
11131  PyObject *__pyx_r = 0;
11132  __Pyx_RefNannyDeclarations
11133  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11134  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
11135 
11136  /* function exit code */
11137  __Pyx_RefNannyFinishContext();
11138  return __pyx_r;
11139 }
11140 
11141 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
11142  PyObject *__pyx_r = NULL;
11143  __Pyx_TraceDeclarations
11144  __Pyx_RefNannyDeclarations
11145  PyObject *__pyx_t_1 = NULL;
11146  int __pyx_lineno = 0;
11147  const char *__pyx_filename = NULL;
11148  int __pyx_clineno = 0;
11149  __Pyx_RefNannySetupContext("__get__", 0);
11150  __Pyx_TraceCall("__get__", __pyx_f[1], 223, 0, __PYX_ERR(1, 223, __pyx_L1_error));
11151 
11152  /* "View.MemoryView":224
11153  * @property
11154  * def memview(self):
11155  * return self.get_memview() # <<<<<<<<<<<<<<
11156  *
11157  * @cname('get_memview')
11158  */
11159  __Pyx_TraceLine(224,0,__PYX_ERR(1, 224, __pyx_L1_error))
11160  __Pyx_XDECREF(__pyx_r);
11161  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
11162  __Pyx_GOTREF(__pyx_t_1);
11163  __pyx_r = __pyx_t_1;
11164  __pyx_t_1 = 0;
11165  goto __pyx_L0;
11166 
11167  /* "View.MemoryView":223
11168  *
11169  * @property
11170  * def memview(self): # <<<<<<<<<<<<<<
11171  * return self.get_memview()
11172  *
11173  */
11174 
11175  /* function exit code */
11176  __pyx_L1_error:;
11177  __Pyx_XDECREF(__pyx_t_1);
11178  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11179  __pyx_r = NULL;
11180  __pyx_L0:;
11181  __Pyx_XGIVEREF(__pyx_r);
11182  __Pyx_TraceReturn(__pyx_r, 0);
11183  __Pyx_RefNannyFinishContext();
11184  return __pyx_r;
11185 }
11186 
11187 /* "View.MemoryView":227
11188  *
11189  * @cname('get_memview')
11190  * cdef get_memview(self): # <<<<<<<<<<<<<<
11191  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
11192  * return memoryview(self, flags, self.dtype_is_object)
11193  */
11194 
11195 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
11196  int __pyx_v_flags;
11197  PyObject *__pyx_r = NULL;
11198  __Pyx_TraceDeclarations
11199  __Pyx_RefNannyDeclarations
11200  PyObject *__pyx_t_1 = NULL;
11201  PyObject *__pyx_t_2 = NULL;
11202  PyObject *__pyx_t_3 = NULL;
11203  int __pyx_lineno = 0;
11204  const char *__pyx_filename = NULL;
11205  int __pyx_clineno = 0;
11206  __Pyx_RefNannySetupContext("get_memview", 0);
11207  __Pyx_TraceCall("get_memview", __pyx_f[1], 227, 0, __PYX_ERR(1, 227, __pyx_L1_error));
11208 
11209  /* "View.MemoryView":228
11210  * @cname('get_memview')
11211  * cdef get_memview(self):
11212  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
11213  * return memoryview(self, flags, self.dtype_is_object)
11214  *
11215  */
11216  __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
11217  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
11218 
11219  /* "View.MemoryView":229
11220  * cdef get_memview(self):
11221  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
11222  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
11223  *
11224  * def __len__(self):
11225  */
11226  __Pyx_TraceLine(229,0,__PYX_ERR(1, 229, __pyx_L1_error))
11227  __Pyx_XDECREF(__pyx_r);
11228  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 229, __pyx_L1_error)
11229  __Pyx_GOTREF(__pyx_t_1);
11230  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
11231  __Pyx_GOTREF(__pyx_t_2);
11232  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
11233  __Pyx_GOTREF(__pyx_t_3);
11234  __Pyx_INCREF(((PyObject *)__pyx_v_self));
11235  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
11236  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
11237  __Pyx_GIVEREF(__pyx_t_1);
11238  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
11239  __Pyx_GIVEREF(__pyx_t_2);
11240  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
11241  __pyx_t_1 = 0;
11242  __pyx_t_2 = 0;
11243  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 229, __pyx_L1_error)
11244  __Pyx_GOTREF(__pyx_t_2);
11245  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11246  __pyx_r = __pyx_t_2;
11247  __pyx_t_2 = 0;
11248  goto __pyx_L0;
11249 
11250  /* "View.MemoryView":227
11251  *
11252  * @cname('get_memview')
11253  * cdef get_memview(self): # <<<<<<<<<<<<<<
11254  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
11255  * return memoryview(self, flags, self.dtype_is_object)
11256  */
11257 
11258  /* function exit code */
11259  __pyx_L1_error:;
11260  __Pyx_XDECREF(__pyx_t_1);
11261  __Pyx_XDECREF(__pyx_t_2);
11262  __Pyx_XDECREF(__pyx_t_3);
11263  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
11264  __pyx_r = 0;
11265  __pyx_L0:;
11266  __Pyx_XGIVEREF(__pyx_r);
11267  __Pyx_TraceReturn(__pyx_r, 0);
11268  __Pyx_RefNannyFinishContext();
11269  return __pyx_r;
11270 }
11271 
11272 /* "View.MemoryView":231
11273  * return memoryview(self, flags, self.dtype_is_object)
11274  *
11275  * def __len__(self): # <<<<<<<<<<<<<<
11276  * return self._shape[0]
11277  *
11278  */
11279 
11280 /* Python wrapper */
11281 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
11282 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
11283  Py_ssize_t __pyx_r;
11284  __Pyx_RefNannyDeclarations
11285  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11286  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
11287 
11288  /* function exit code */
11289  __Pyx_RefNannyFinishContext();
11290  return __pyx_r;
11291 }
11292 
11293 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
11294  Py_ssize_t __pyx_r;
11295  __Pyx_TraceDeclarations
11296  __Pyx_RefNannyDeclarations
11297  int __pyx_lineno = 0;
11298  const char *__pyx_filename = NULL;
11299  int __pyx_clineno = 0;
11300  __Pyx_RefNannySetupContext("__len__", 0);
11301  __Pyx_TraceCall("__len__", __pyx_f[1], 231, 0, __PYX_ERR(1, 231, __pyx_L1_error));
11302 
11303  /* "View.MemoryView":232
11304  *
11305  * def __len__(self):
11306  * return self._shape[0] # <<<<<<<<<<<<<<
11307  *
11308  * def __getattr__(self, attr):
11309  */
11310  __Pyx_TraceLine(232,0,__PYX_ERR(1, 232, __pyx_L1_error))
11311  __pyx_r = (__pyx_v_self->_shape[0]);
11312  goto __pyx_L0;
11313 
11314  /* "View.MemoryView":231
11315  * return memoryview(self, flags, self.dtype_is_object)
11316  *
11317  * def __len__(self): # <<<<<<<<<<<<<<
11318  * return self._shape[0]
11319  *
11320  */
11321 
11322  /* function exit code */
11323  __pyx_L1_error:;
11324  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11325  __pyx_r = -1;
11326  __pyx_L0:;
11327  __Pyx_TraceReturn(Py_None, 0);
11328  __Pyx_RefNannyFinishContext();
11329  return __pyx_r;
11330 }
11331 
11332 /* "View.MemoryView":234
11333  * return self._shape[0]
11334  *
11335  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
11336  * return getattr(self.memview, attr)
11337  *
11338  */
11339 
11340 /* Python wrapper */
11341 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
11342 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
11343  PyObject *__pyx_r = 0;
11344  __Pyx_RefNannyDeclarations
11345  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
11346  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
11347 
11348  /* function exit code */
11349  __Pyx_RefNannyFinishContext();
11350  return __pyx_r;
11351 }
11352 
11353 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
11354  PyObject *__pyx_r = NULL;
11355  __Pyx_TraceDeclarations
11356  __Pyx_RefNannyDeclarations
11357  PyObject *__pyx_t_1 = NULL;
11358  PyObject *__pyx_t_2 = NULL;
11359  int __pyx_lineno = 0;
11360  const char *__pyx_filename = NULL;
11361  int __pyx_clineno = 0;
11362  __Pyx_RefNannySetupContext("__getattr__", 0);
11363  __Pyx_TraceCall("__getattr__", __pyx_f[1], 234, 0, __PYX_ERR(1, 234, __pyx_L1_error));
11364 
11365  /* "View.MemoryView":235
11366  *
11367  * def __getattr__(self, attr):
11368  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
11369  *
11370  * def __getitem__(self, item):
11371  */
11372  __Pyx_TraceLine(235,0,__PYX_ERR(1, 235, __pyx_L1_error))
11373  __Pyx_XDECREF(__pyx_r);
11374  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
11375  __Pyx_GOTREF(__pyx_t_1);
11376  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
11377  __Pyx_GOTREF(__pyx_t_2);
11378  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11379  __pyx_r = __pyx_t_2;
11380  __pyx_t_2 = 0;
11381  goto __pyx_L0;
11382 
11383  /* "View.MemoryView":234
11384  * return self._shape[0]
11385  *
11386  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
11387  * return getattr(self.memview, attr)
11388  *
11389  */
11390 
11391  /* function exit code */
11392  __pyx_L1_error:;
11393  __Pyx_XDECREF(__pyx_t_1);
11394  __Pyx_XDECREF(__pyx_t_2);
11395  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11396  __pyx_r = NULL;
11397  __pyx_L0:;
11398  __Pyx_XGIVEREF(__pyx_r);
11399  __Pyx_TraceReturn(__pyx_r, 0);
11400  __Pyx_RefNannyFinishContext();
11401  return __pyx_r;
11402 }
11403 
11404 /* "View.MemoryView":237
11405  * return getattr(self.memview, attr)
11406  *
11407  * def __getitem__(self, item): # <<<<<<<<<<<<<<
11408  * return self.memview[item]
11409  *
11410  */
11411 
11412 /* Python wrapper */
11413 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
11414 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
11415  PyObject *__pyx_r = 0;
11416  __Pyx_RefNannyDeclarations
11417  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
11418  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
11419 
11420  /* function exit code */
11421  __Pyx_RefNannyFinishContext();
11422  return __pyx_r;
11423 }
11424 
11425 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
11426  PyObject *__pyx_r = NULL;
11427  __Pyx_TraceDeclarations
11428  __Pyx_RefNannyDeclarations
11429  PyObject *__pyx_t_1 = NULL;
11430  PyObject *__pyx_t_2 = NULL;
11431  int __pyx_lineno = 0;
11432  const char *__pyx_filename = NULL;
11433  int __pyx_clineno = 0;
11434  __Pyx_RefNannySetupContext("__getitem__", 0);
11435  __Pyx_TraceCall("__getitem__", __pyx_f[1], 237, 0, __PYX_ERR(1, 237, __pyx_L1_error));
11436 
11437  /* "View.MemoryView":238
11438  *
11439  * def __getitem__(self, item):
11440  * return self.memview[item] # <<<<<<<<<<<<<<
11441  *
11442  * def __setitem__(self, item, value):
11443  */
11444  __Pyx_TraceLine(238,0,__PYX_ERR(1, 238, __pyx_L1_error))
11445  __Pyx_XDECREF(__pyx_r);
11446  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
11447  __Pyx_GOTREF(__pyx_t_1);
11448  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 238, __pyx_L1_error)
11449  __Pyx_GOTREF(__pyx_t_2);
11450  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11451  __pyx_r = __pyx_t_2;
11452  __pyx_t_2 = 0;
11453  goto __pyx_L0;
11454 
11455  /* "View.MemoryView":237
11456  * return getattr(self.memview, attr)
11457  *
11458  * def __getitem__(self, item): # <<<<<<<<<<<<<<
11459  * return self.memview[item]
11460  *
11461  */
11462 
11463  /* function exit code */
11464  __pyx_L1_error:;
11465  __Pyx_XDECREF(__pyx_t_1);
11466  __Pyx_XDECREF(__pyx_t_2);
11467  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11468  __pyx_r = NULL;
11469  __pyx_L0:;
11470  __Pyx_XGIVEREF(__pyx_r);
11471  __Pyx_TraceReturn(__pyx_r, 0);
11472  __Pyx_RefNannyFinishContext();
11473  return __pyx_r;
11474 }
11475 
11476 /* "View.MemoryView":240
11477  * return self.memview[item]
11478  *
11479  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
11480  * self.memview[item] = value
11481  *
11482  */
11483 
11484 /* Python wrapper */
11485 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
11486 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
11487  int __pyx_r;
11488  __Pyx_RefNannyDeclarations
11489  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11490  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
11491 
11492  /* function exit code */
11493  __Pyx_RefNannyFinishContext();
11494  return __pyx_r;
11495 }
11496 
11497 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
11498  int __pyx_r;
11499  __Pyx_TraceDeclarations
11500  __Pyx_RefNannyDeclarations
11501  PyObject *__pyx_t_1 = NULL;
11502  int __pyx_lineno = 0;
11503  const char *__pyx_filename = NULL;
11504  int __pyx_clineno = 0;
11505  __Pyx_RefNannySetupContext("__setitem__", 0);
11506  __Pyx_TraceCall("__setitem__", __pyx_f[1], 240, 0, __PYX_ERR(1, 240, __pyx_L1_error));
11507 
11508  /* "View.MemoryView":241
11509  *
11510  * def __setitem__(self, item, value):
11511  * self.memview[item] = value # <<<<<<<<<<<<<<
11512  *
11513  *
11514  */
11515  __Pyx_TraceLine(241,0,__PYX_ERR(1, 241, __pyx_L1_error))
11516  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
11517  __Pyx_GOTREF(__pyx_t_1);
11518  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 241, __pyx_L1_error)
11519  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11520 
11521  /* "View.MemoryView":240
11522  * return self.memview[item]
11523  *
11524  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
11525  * self.memview[item] = value
11526  *
11527  */
11528 
11529  /* function exit code */
11530  __pyx_r = 0;
11531  goto __pyx_L0;
11532  __pyx_L1_error:;
11533  __Pyx_XDECREF(__pyx_t_1);
11534  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11535  __pyx_r = -1;
11536  __pyx_L0:;
11537  __Pyx_TraceReturn(Py_None, 0);
11538  __Pyx_RefNannyFinishContext();
11539  return __pyx_r;
11540 }
11541 
11542 /* "(tree fragment)":1
11543  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11544  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11545  * def __setstate_cython__(self, __pyx_state):
11546  */
11547 
11548 /* Python wrapper */
11549 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
11550 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
11551 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11552  PyObject *__pyx_r = 0;
11553  __Pyx_RefNannyDeclarations
11554  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11555  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
11556 
11557  /* function exit code */
11558  __Pyx_RefNannyFinishContext();
11559  return __pyx_r;
11560 }
11561 
11562 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
11563  PyObject *__pyx_r = NULL;
11564  __Pyx_TraceDeclarations
11565  __Pyx_RefNannyDeclarations
11566  PyObject *__pyx_t_1 = NULL;
11567  int __pyx_lineno = 0;
11568  const char *__pyx_filename = NULL;
11569  int __pyx_clineno = 0;
11570  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11571  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
11572 
11573  /* "(tree fragment)":2
11574  * def __reduce_cython__(self):
11575  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11576  * def __setstate_cython__(self, __pyx_state):
11577  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11578  */
11579  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
11580  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
11581  __Pyx_GOTREF(__pyx_t_1);
11582  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11583  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11584  __PYX_ERR(1, 2, __pyx_L1_error)
11585 
11586  /* "(tree fragment)":1
11587  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11588  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11589  * def __setstate_cython__(self, __pyx_state):
11590  */
11591 
11592  /* function exit code */
11593  __pyx_L1_error:;
11594  __Pyx_XDECREF(__pyx_t_1);
11595  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11596  __pyx_r = NULL;
11597  __Pyx_XGIVEREF(__pyx_r);
11598  __Pyx_TraceReturn(__pyx_r, 0);
11599  __Pyx_RefNannyFinishContext();
11600  return __pyx_r;
11601 }
11602 
11603 /* "(tree fragment)":3
11604  * def __reduce_cython__(self):
11605  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11606  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11607  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11608  */
11609 
11610 /* Python wrapper */
11611 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
11612 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
11613 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11614  PyObject *__pyx_r = 0;
11615  __Pyx_RefNannyDeclarations
11616  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11617  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11618 
11619  /* function exit code */
11620  __Pyx_RefNannyFinishContext();
11621  return __pyx_r;
11622 }
11623 
11624 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11625  PyObject *__pyx_r = NULL;
11626  __Pyx_TraceDeclarations
11627  __Pyx_RefNannyDeclarations
11628  PyObject *__pyx_t_1 = NULL;
11629  int __pyx_lineno = 0;
11630  const char *__pyx_filename = NULL;
11631  int __pyx_clineno = 0;
11632  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11633  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
11634 
11635  /* "(tree fragment)":4
11636  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11637  * def __setstate_cython__(self, __pyx_state):
11638  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
11639  */
11640  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
11641  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
11642  __Pyx_GOTREF(__pyx_t_1);
11643  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11644  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11645  __PYX_ERR(1, 4, __pyx_L1_error)
11646 
11647  /* "(tree fragment)":3
11648  * def __reduce_cython__(self):
11649  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11650  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11651  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
11652  */
11653 
11654  /* function exit code */
11655  __pyx_L1_error:;
11656  __Pyx_XDECREF(__pyx_t_1);
11657  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11658  __pyx_r = NULL;
11659  __Pyx_XGIVEREF(__pyx_r);
11660  __Pyx_TraceReturn(__pyx_r, 0);
11661  __Pyx_RefNannyFinishContext();
11662  return __pyx_r;
11663 }
11664 
11665 /* "View.MemoryView":245
11666  *
11667  * @cname("__pyx_array_new")
11668  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
11669  * char *mode, char *buf):
11670  * cdef array result
11671  */
11672 
11673 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
11674  struct __pyx_array_obj *__pyx_v_result = 0;
11675  struct __pyx_array_obj *__pyx_r = NULL;
11676  __Pyx_TraceDeclarations
11677  __Pyx_RefNannyDeclarations
11678  int __pyx_t_1;
11679  PyObject *__pyx_t_2 = NULL;
11680  PyObject *__pyx_t_3 = NULL;
11681  PyObject *__pyx_t_4 = NULL;
11682  PyObject *__pyx_t_5 = NULL;
11683  int __pyx_lineno = 0;
11684  const char *__pyx_filename = NULL;
11685  int __pyx_clineno = 0;
11686  __Pyx_RefNannySetupContext("array_cwrapper", 0);
11687  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 245, 0, __PYX_ERR(1, 245, __pyx_L1_error));
11688 
11689  /* "View.MemoryView":249
11690  * cdef array result
11691  *
11692  * if buf == NULL: # <<<<<<<<<<<<<<
11693  * result = array(shape, itemsize, format, mode.decode('ASCII'))
11694  * else:
11695  */
11696  __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
11697  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
11698  if (__pyx_t_1) {
11699 
11700  /* "View.MemoryView":250
11701  *
11702  * if buf == NULL:
11703  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
11704  * else:
11705  * result = array(shape, itemsize, format, mode.decode('ASCII'),
11706  */
11707  __Pyx_TraceLine(250,0,__PYX_ERR(1, 250, __pyx_L1_error))
11708  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 250, __pyx_L1_error)
11709  __Pyx_GOTREF(__pyx_t_2);
11710  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 250, __pyx_L1_error)
11711  __Pyx_GOTREF(__pyx_t_3);
11712  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
11713  __Pyx_GOTREF(__pyx_t_4);
11714  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 250, __pyx_L1_error)
11715  __Pyx_GOTREF(__pyx_t_5);
11716  __Pyx_INCREF(__pyx_v_shape);
11717  __Pyx_GIVEREF(__pyx_v_shape);
11718  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
11719  __Pyx_GIVEREF(__pyx_t_2);
11720  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
11721  __Pyx_GIVEREF(__pyx_t_3);
11722  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
11723  __Pyx_GIVEREF(__pyx_t_4);
11724  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
11725  __pyx_t_2 = 0;
11726  __pyx_t_3 = 0;
11727  __pyx_t_4 = 0;
11728  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 250, __pyx_L1_error)
11729  __Pyx_GOTREF(__pyx_t_4);
11730  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11731  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
11732  __pyx_t_4 = 0;
11733 
11734  /* "View.MemoryView":249
11735  * cdef array result
11736  *
11737  * if buf == NULL: # <<<<<<<<<<<<<<
11738  * result = array(shape, itemsize, format, mode.decode('ASCII'))
11739  * else:
11740  */
11741  goto __pyx_L3;
11742  }
11743 
11744  /* "View.MemoryView":252
11745  * result = array(shape, itemsize, format, mode.decode('ASCII'))
11746  * else:
11747  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
11748  * allocate_buffer=False)
11749  * result.data = buf
11750  */
11751  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
11752  /*else*/ {
11753  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 252, __pyx_L1_error)
11754  __Pyx_GOTREF(__pyx_t_4);
11755  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
11756  __Pyx_GOTREF(__pyx_t_5);
11757  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
11758  __Pyx_GOTREF(__pyx_t_3);
11759  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 252, __pyx_L1_error)
11760  __Pyx_GOTREF(__pyx_t_2);
11761  __Pyx_INCREF(__pyx_v_shape);
11762  __Pyx_GIVEREF(__pyx_v_shape);
11763  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
11764  __Pyx_GIVEREF(__pyx_t_4);
11765  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
11766  __Pyx_GIVEREF(__pyx_t_5);
11767  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
11768  __Pyx_GIVEREF(__pyx_t_3);
11769  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
11770  __pyx_t_4 = 0;
11771  __pyx_t_5 = 0;
11772  __pyx_t_3 = 0;
11773 
11774  /* "View.MemoryView":253
11775  * else:
11776  * result = array(shape, itemsize, format, mode.decode('ASCII'),
11777  * allocate_buffer=False) # <<<<<<<<<<<<<<
11778  * result.data = buf
11779  *
11780  */
11781  __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
11782  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
11783  __Pyx_GOTREF(__pyx_t_3);
11784  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 253, __pyx_L1_error)
11785 
11786  /* "View.MemoryView":252
11787  * result = array(shape, itemsize, format, mode.decode('ASCII'))
11788  * else:
11789  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
11790  * allocate_buffer=False)
11791  * result.data = buf
11792  */
11793  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
11794  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 252, __pyx_L1_error)
11795  __Pyx_GOTREF(__pyx_t_5);
11796  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11797  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11798  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
11799  __pyx_t_5 = 0;
11800 
11801  /* "View.MemoryView":254
11802  * result = array(shape, itemsize, format, mode.decode('ASCII'),
11803  * allocate_buffer=False)
11804  * result.data = buf # <<<<<<<<<<<<<<
11805  *
11806  * return result
11807  */
11808  __Pyx_TraceLine(254,0,__PYX_ERR(1, 254, __pyx_L1_error))
11809  __pyx_v_result->data = __pyx_v_buf;
11810  }
11811  __pyx_L3:;
11812 
11813  /* "View.MemoryView":256
11814  * result.data = buf
11815  *
11816  * return result # <<<<<<<<<<<<<<
11817  *
11818  *
11819  */
11820  __Pyx_TraceLine(256,0,__PYX_ERR(1, 256, __pyx_L1_error))
11821  __Pyx_XDECREF(((PyObject *)__pyx_r));
11822  __Pyx_INCREF(((PyObject *)__pyx_v_result));
11823  __pyx_r = __pyx_v_result;
11824  goto __pyx_L0;
11825 
11826  /* "View.MemoryView":245
11827  *
11828  * @cname("__pyx_array_new")
11829  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
11830  * char *mode, char *buf):
11831  * cdef array result
11832  */
11833 
11834  /* function exit code */
11835  __pyx_L1_error:;
11836  __Pyx_XDECREF(__pyx_t_2);
11837  __Pyx_XDECREF(__pyx_t_3);
11838  __Pyx_XDECREF(__pyx_t_4);
11839  __Pyx_XDECREF(__pyx_t_5);
11840  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11841  __pyx_r = 0;
11842  __pyx_L0:;
11843  __Pyx_XDECREF((PyObject *)__pyx_v_result);
11844  __Pyx_XGIVEREF((PyObject *)__pyx_r);
11845  __Pyx_TraceReturn(__pyx_r, 0);
11846  __Pyx_RefNannyFinishContext();
11847  return __pyx_r;
11848 }
11849 
11850 /* "View.MemoryView":282
11851  * cdef class Enum(object):
11852  * cdef object name
11853  * def __init__(self, name): # <<<<<<<<<<<<<<
11854  * self.name = name
11855  * def __repr__(self):
11856  */
11857 
11858 /* Python wrapper */
11859 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11860 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11861  PyObject *__pyx_v_name = 0;
11862  int __pyx_lineno = 0;
11863  const char *__pyx_filename = NULL;
11864  int __pyx_clineno = 0;
11865  int __pyx_r;
11866  __Pyx_RefNannyDeclarations
11867  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
11868  {
11869  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
11870  PyObject* values[1] = {0};
11871  if (unlikely(__pyx_kwds)) {
11872  Py_ssize_t kw_args;
11873  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11874  switch (pos_args) {
11875  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11876  CYTHON_FALLTHROUGH;
11877  case 0: break;
11878  default: goto __pyx_L5_argtuple_error;
11879  }
11880  kw_args = PyDict_Size(__pyx_kwds);
11881  switch (pos_args) {
11882  case 0:
11883  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
11884  else goto __pyx_L5_argtuple_error;
11885  }
11886  if (unlikely(kw_args > 0)) {
11887  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 282, __pyx_L3_error)
11888  }
11889  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
11890  goto __pyx_L5_argtuple_error;
11891  } else {
11892  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11893  }
11894  __pyx_v_name = values[0];
11895  }
11896  goto __pyx_L4_argument_unpacking_done;
11897  __pyx_L5_argtuple_error:;
11898  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 282, __pyx_L3_error)
11899  __pyx_L3_error:;
11900  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11901  __Pyx_RefNannyFinishContext();
11902  return -1;
11903  __pyx_L4_argument_unpacking_done:;
11904  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
11905 
11906  /* function exit code */
11907  __Pyx_RefNannyFinishContext();
11908  return __pyx_r;
11909 }
11910 
11911 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
11912  int __pyx_r;
11913  __Pyx_TraceDeclarations
11914  __Pyx_RefNannyDeclarations
11915  int __pyx_lineno = 0;
11916  const char *__pyx_filename = NULL;
11917  int __pyx_clineno = 0;
11918  __Pyx_RefNannySetupContext("__init__", 0);
11919  __Pyx_TraceCall("__init__", __pyx_f[1], 282, 0, __PYX_ERR(1, 282, __pyx_L1_error));
11920 
11921  /* "View.MemoryView":283
11922  * cdef object name
11923  * def __init__(self, name):
11924  * self.name = name # <<<<<<<<<<<<<<
11925  * def __repr__(self):
11926  * return self.name
11927  */
11928  __Pyx_TraceLine(283,0,__PYX_ERR(1, 283, __pyx_L1_error))
11929  __Pyx_INCREF(__pyx_v_name);
11930  __Pyx_GIVEREF(__pyx_v_name);
11931  __Pyx_GOTREF(__pyx_v_self->name);
11932  __Pyx_DECREF(__pyx_v_self->name);
11933  __pyx_v_self->name = __pyx_v_name;
11934 
11935  /* "View.MemoryView":282
11936  * cdef class Enum(object):
11937  * cdef object name
11938  * def __init__(self, name): # <<<<<<<<<<<<<<
11939  * self.name = name
11940  * def __repr__(self):
11941  */
11942 
11943  /* function exit code */
11944  __pyx_r = 0;
11945  goto __pyx_L0;
11946  __pyx_L1_error:;
11947  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11948  __pyx_r = -1;
11949  __pyx_L0:;
11950  __Pyx_TraceReturn(Py_None, 0);
11951  __Pyx_RefNannyFinishContext();
11952  return __pyx_r;
11953 }
11954 
11955 /* "View.MemoryView":284
11956  * def __init__(self, name):
11957  * self.name = name
11958  * def __repr__(self): # <<<<<<<<<<<<<<
11959  * return self.name
11960  *
11961  */
11962 
11963 /* Python wrapper */
11964 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
11965 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
11966  PyObject *__pyx_r = 0;
11967  __Pyx_RefNannyDeclarations
11968  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11969  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
11970 
11971  /* function exit code */
11972  __Pyx_RefNannyFinishContext();
11973  return __pyx_r;
11974 }
11975 
11976 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
11977  PyObject *__pyx_r = NULL;
11978  __Pyx_TraceDeclarations
11979  __Pyx_RefNannyDeclarations
11980  int __pyx_lineno = 0;
11981  const char *__pyx_filename = NULL;
11982  int __pyx_clineno = 0;
11983  __Pyx_RefNannySetupContext("__repr__", 0);
11984  __Pyx_TraceCall("__repr__", __pyx_f[1], 284, 0, __PYX_ERR(1, 284, __pyx_L1_error));
11985 
11986  /* "View.MemoryView":285
11987  * self.name = name
11988  * def __repr__(self):
11989  * return self.name # <<<<<<<<<<<<<<
11990  *
11991  * cdef generic = Enum("<strided and direct or indirect>")
11992  */
11993  __Pyx_TraceLine(285,0,__PYX_ERR(1, 285, __pyx_L1_error))
11994  __Pyx_XDECREF(__pyx_r);
11995  __Pyx_INCREF(__pyx_v_self->name);
11996  __pyx_r = __pyx_v_self->name;
11997  goto __pyx_L0;
11998 
11999  /* "View.MemoryView":284
12000  * def __init__(self, name):
12001  * self.name = name
12002  * def __repr__(self): # <<<<<<<<<<<<<<
12003  * return self.name
12004  *
12005  */
12006 
12007  /* function exit code */
12008  __pyx_L1_error:;
12009  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12010  __pyx_r = NULL;
12011  __pyx_L0:;
12012  __Pyx_XGIVEREF(__pyx_r);
12013  __Pyx_TraceReturn(__pyx_r, 0);
12014  __Pyx_RefNannyFinishContext();
12015  return __pyx_r;
12016 }
12017 
12018 /* "(tree fragment)":1
12019  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12020  * cdef tuple state
12021  * cdef object _dict
12022  */
12023 
12024 /* Python wrapper */
12025 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12026 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
12027 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12028  PyObject *__pyx_r = 0;
12029  __Pyx_RefNannyDeclarations
12030  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12031  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
12032 
12033  /* function exit code */
12034  __Pyx_RefNannyFinishContext();
12035  return __pyx_r;
12036 }
12037 
12038 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
12039  PyObject *__pyx_v_state = 0;
12040  PyObject *__pyx_v__dict = 0;
12041  int __pyx_v_use_setstate;
12042  PyObject *__pyx_r = NULL;
12043  __Pyx_TraceDeclarations
12044  __Pyx_RefNannyDeclarations
12045  PyObject *__pyx_t_1 = NULL;
12046  int __pyx_t_2;
12047  int __pyx_t_3;
12048  PyObject *__pyx_t_4 = NULL;
12049  PyObject *__pyx_t_5 = NULL;
12050  int __pyx_lineno = 0;
12051  const char *__pyx_filename = NULL;
12052  int __pyx_clineno = 0;
12053  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12054  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
12055 
12056  /* "(tree fragment)":5
12057  * cdef object _dict
12058  * cdef bint use_setstate
12059  * state = (self.name,) # <<<<<<<<<<<<<<
12060  * _dict = getattr(self, '__dict__', None)
12061  * if _dict is not None:
12062  */
12063  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
12064  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
12065  __Pyx_GOTREF(__pyx_t_1);
12066  __Pyx_INCREF(__pyx_v_self->name);
12067  __Pyx_GIVEREF(__pyx_v_self->name);
12068  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
12069  __pyx_v_state = ((PyObject*)__pyx_t_1);
12070  __pyx_t_1 = 0;
12071 
12072  /* "(tree fragment)":6
12073  * cdef bint use_setstate
12074  * state = (self.name,)
12075  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
12076  * if _dict is not None:
12077  * state += (_dict,)
12078  */
12079  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
12080  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
12081  __Pyx_GOTREF(__pyx_t_1);
12082  __pyx_v__dict = __pyx_t_1;
12083  __pyx_t_1 = 0;
12084 
12085  /* "(tree fragment)":7
12086  * state = (self.name,)
12087  * _dict = getattr(self, '__dict__', None)
12088  * if _dict is not None: # <<<<<<<<<<<<<<
12089  * state += (_dict,)
12090  * use_setstate = True
12091  */
12092  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
12093  __pyx_t_2 = (__pyx_v__dict != Py_None);
12094  __pyx_t_3 = (__pyx_t_2 != 0);
12095  if (__pyx_t_3) {
12096 
12097  /* "(tree fragment)":8
12098  * _dict = getattr(self, '__dict__', None)
12099  * if _dict is not None:
12100  * state += (_dict,) # <<<<<<<<<<<<<<
12101  * use_setstate = True
12102  * else:
12103  */
12104  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
12105  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
12106  __Pyx_GOTREF(__pyx_t_1);
12107  __Pyx_INCREF(__pyx_v__dict);
12108  __Pyx_GIVEREF(__pyx_v__dict);
12109  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
12110  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
12111  __Pyx_GOTREF(__pyx_t_4);
12112  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12113  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
12114  __pyx_t_4 = 0;
12115 
12116  /* "(tree fragment)":9
12117  * if _dict is not None:
12118  * state += (_dict,)
12119  * use_setstate = True # <<<<<<<<<<<<<<
12120  * else:
12121  * use_setstate = self.name is not None
12122  */
12123  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
12124  __pyx_v_use_setstate = 1;
12125 
12126  /* "(tree fragment)":7
12127  * state = (self.name,)
12128  * _dict = getattr(self, '__dict__', None)
12129  * if _dict is not None: # <<<<<<<<<<<<<<
12130  * state += (_dict,)
12131  * use_setstate = True
12132  */
12133  goto __pyx_L3;
12134  }
12135 
12136  /* "(tree fragment)":11
12137  * use_setstate = True
12138  * else:
12139  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
12140  * if use_setstate:
12141  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
12142  */
12143  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
12144  /*else*/ {
12145  __pyx_t_3 = (__pyx_v_self->name != Py_None);
12146  __pyx_v_use_setstate = __pyx_t_3;
12147  }
12148  __pyx_L3:;
12149 
12150  /* "(tree fragment)":12
12151  * else:
12152  * use_setstate = self.name is not None
12153  * if use_setstate: # <<<<<<<<<<<<<<
12154  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
12155  * else:
12156  */
12157  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
12158  __pyx_t_3 = (__pyx_v_use_setstate != 0);
12159  if (__pyx_t_3) {
12160 
12161  /* "(tree fragment)":13
12162  * use_setstate = self.name is not None
12163  * if use_setstate:
12164  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
12165  * else:
12166  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
12167  */
12168  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
12169  __Pyx_XDECREF(__pyx_r);
12170  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
12171  __Pyx_GOTREF(__pyx_t_4);
12172  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
12173  __Pyx_GOTREF(__pyx_t_1);
12174  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12175  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12176  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12177  __Pyx_INCREF(__pyx_int_184977713);
12178  __Pyx_GIVEREF(__pyx_int_184977713);
12179  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
12180  __Pyx_INCREF(Py_None);
12181  __Pyx_GIVEREF(Py_None);
12182  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
12183  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
12184  __Pyx_GOTREF(__pyx_t_5);
12185  __Pyx_GIVEREF(__pyx_t_4);
12186  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12187  __Pyx_GIVEREF(__pyx_t_1);
12188  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
12189  __Pyx_INCREF(__pyx_v_state);
12190  __Pyx_GIVEREF(__pyx_v_state);
12191  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
12192  __pyx_t_4 = 0;
12193  __pyx_t_1 = 0;
12194  __pyx_r = __pyx_t_5;
12195  __pyx_t_5 = 0;
12196  goto __pyx_L0;
12197 
12198  /* "(tree fragment)":12
12199  * else:
12200  * use_setstate = self.name is not None
12201  * if use_setstate: # <<<<<<<<<<<<<<
12202  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
12203  * else:
12204  */
12205  }
12206 
12207  /* "(tree fragment)":15
12208  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
12209  * else:
12210  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
12211  * def __setstate_cython__(self, __pyx_state):
12212  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
12213  */
12214  __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
12215  /*else*/ {
12216  __Pyx_XDECREF(__pyx_r);
12217  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
12218  __Pyx_GOTREF(__pyx_t_5);
12219  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
12220  __Pyx_GOTREF(__pyx_t_1);
12221  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12222  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12223  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
12224  __Pyx_INCREF(__pyx_int_184977713);
12225  __Pyx_GIVEREF(__pyx_int_184977713);
12226  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
12227  __Pyx_INCREF(__pyx_v_state);
12228  __Pyx_GIVEREF(__pyx_v_state);
12229  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
12230  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
12231  __Pyx_GOTREF(__pyx_t_4);
12232  __Pyx_GIVEREF(__pyx_t_5);
12233  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
12234  __Pyx_GIVEREF(__pyx_t_1);
12235  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
12236  __pyx_t_5 = 0;
12237  __pyx_t_1 = 0;
12238  __pyx_r = __pyx_t_4;
12239  __pyx_t_4 = 0;
12240  goto __pyx_L0;
12241  }
12242 
12243  /* "(tree fragment)":1
12244  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12245  * cdef tuple state
12246  * cdef object _dict
12247  */
12248 
12249  /* function exit code */
12250  __pyx_L1_error:;
12251  __Pyx_XDECREF(__pyx_t_1);
12252  __Pyx_XDECREF(__pyx_t_4);
12253  __Pyx_XDECREF(__pyx_t_5);
12254  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12255  __pyx_r = NULL;
12256  __pyx_L0:;
12257  __Pyx_XDECREF(__pyx_v_state);
12258  __Pyx_XDECREF(__pyx_v__dict);
12259  __Pyx_XGIVEREF(__pyx_r);
12260  __Pyx_TraceReturn(__pyx_r, 0);
12261  __Pyx_RefNannyFinishContext();
12262  return __pyx_r;
12263 }
12264 
12265 /* "(tree fragment)":16
12266  * else:
12267  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
12268  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12269  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
12270  */
12271 
12272 /* Python wrapper */
12273 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
12274 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
12275 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12276  PyObject *__pyx_r = 0;
12277  __Pyx_RefNannyDeclarations
12278  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12279  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12280 
12281  /* function exit code */
12282  __Pyx_RefNannyFinishContext();
12283  return __pyx_r;
12284 }
12285 
12286 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12287  PyObject *__pyx_r = NULL;
12288  __Pyx_TraceDeclarations
12289  __Pyx_RefNannyDeclarations
12290  PyObject *__pyx_t_1 = NULL;
12291  int __pyx_lineno = 0;
12292  const char *__pyx_filename = NULL;
12293  int __pyx_clineno = 0;
12294  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12295  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
12296 
12297  /* "(tree fragment)":17
12298  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
12299  * def __setstate_cython__(self, __pyx_state):
12300  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
12301  */
12302  __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
12303  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
12304  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
12305  __Pyx_GOTREF(__pyx_t_1);
12306  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12307 
12308  /* "(tree fragment)":16
12309  * else:
12310  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
12311  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12312  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
12313  */
12314 
12315  /* function exit code */
12316  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12317  goto __pyx_L0;
12318  __pyx_L1_error:;
12319  __Pyx_XDECREF(__pyx_t_1);
12320  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12321  __pyx_r = NULL;
12322  __pyx_L0:;
12323  __Pyx_XGIVEREF(__pyx_r);
12324  __Pyx_TraceReturn(__pyx_r, 0);
12325  __Pyx_RefNannyFinishContext();
12326  return __pyx_r;
12327 }
12328 
12329 /* "View.MemoryView":299
12330  *
12331  * @cname('__pyx_align_pointer')
12332  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
12333  * "Align pointer memory on a given boundary"
12334  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
12335  */
12336 
12337 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
12338  Py_intptr_t __pyx_v_aligned_p;
12339  size_t __pyx_v_offset;
12340  void *__pyx_r;
12341  __Pyx_TraceDeclarations
12342  int __pyx_t_1;
12343  int __pyx_lineno = 0;
12344  const char *__pyx_filename = NULL;
12345  int __pyx_clineno = 0;
12346  __Pyx_TraceCall("align_pointer", __pyx_f[1], 299, 1, __PYX_ERR(1, 299, __pyx_L1_error));
12347 
12348  /* "View.MemoryView":301
12349  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
12350  * "Align pointer memory on a given boundary"
12351  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
12352  * cdef size_t offset
12353  *
12354  */
12355  __Pyx_TraceLine(301,1,__PYX_ERR(1, 301, __pyx_L1_error))
12356  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
12357 
12358  /* "View.MemoryView":305
12359  *
12360  * with cython.cdivision(True):
12361  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
12362  *
12363  * if offset > 0:
12364  */
12365  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
12366 
12367  /* "View.MemoryView":307
12368  * offset = aligned_p % alignment
12369  *
12370  * if offset > 0: # <<<<<<<<<<<<<<
12371  * aligned_p += alignment - offset
12372  *
12373  */
12374  __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
12375  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
12376  if (__pyx_t_1) {
12377 
12378  /* "View.MemoryView":308
12379  *
12380  * if offset > 0:
12381  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
12382  *
12383  * return <void *> aligned_p
12384  */
12385  __Pyx_TraceLine(308,1,__PYX_ERR(1, 308, __pyx_L1_error))
12386  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
12387 
12388  /* "View.MemoryView":307
12389  * offset = aligned_p % alignment
12390  *
12391  * if offset > 0: # <<<<<<<<<<<<<<
12392  * aligned_p += alignment - offset
12393  *
12394  */
12395  }
12396 
12397  /* "View.MemoryView":310
12398  * aligned_p += alignment - offset
12399  *
12400  * return <void *> aligned_p # <<<<<<<<<<<<<<
12401  *
12402  *
12403  */
12404  __Pyx_TraceLine(310,1,__PYX_ERR(1, 310, __pyx_L1_error))
12405  __pyx_r = ((void *)__pyx_v_aligned_p);
12406  goto __pyx_L0;
12407 
12408  /* "View.MemoryView":299
12409  *
12410  * @cname('__pyx_align_pointer')
12411  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
12412  * "Align pointer memory on a given boundary"
12413  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
12414  */
12415 
12416  /* function exit code */
12417  __pyx_L1_error:;
12418  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
12419  __pyx_r = 0;
12420  __pyx_L0:;
12421  __Pyx_TraceReturn(Py_None, 1);
12422  return __pyx_r;
12423 }
12424 
12425 /* "View.MemoryView":346
12426  * cdef __Pyx_TypeInfo *typeinfo
12427  *
12428  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
12429  * self.obj = obj
12430  * self.flags = flags
12431  */
12432 
12433 /* Python wrapper */
12434 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12435 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12436  PyObject *__pyx_v_obj = 0;
12437  int __pyx_v_flags;
12438  int __pyx_v_dtype_is_object;
12439  int __pyx_lineno = 0;
12440  const char *__pyx_filename = NULL;
12441  int __pyx_clineno = 0;
12442  int __pyx_r;
12443  __Pyx_RefNannyDeclarations
12444  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
12445  {
12446  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
12447  PyObject* values[3] = {0,0,0};
12448  if (unlikely(__pyx_kwds)) {
12449  Py_ssize_t kw_args;
12450  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12451  switch (pos_args) {
12452  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12453  CYTHON_FALLTHROUGH;
12454  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12455  CYTHON_FALLTHROUGH;
12456  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12457  CYTHON_FALLTHROUGH;
12458  case 0: break;
12459  default: goto __pyx_L5_argtuple_error;
12460  }
12461  kw_args = PyDict_Size(__pyx_kwds);
12462  switch (pos_args) {
12463  case 0:
12464  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
12465  else goto __pyx_L5_argtuple_error;
12466  CYTHON_FALLTHROUGH;
12467  case 1:
12468  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
12469  else {
12470  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 346, __pyx_L3_error)
12471  }
12472  CYTHON_FALLTHROUGH;
12473  case 2:
12474  if (kw_args > 0) {
12475  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
12476  if (value) { values[2] = value; kw_args--; }
12477  }
12478  }
12479  if (unlikely(kw_args > 0)) {
12480  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 346, __pyx_L3_error)
12481  }
12482  } else {
12483  switch (PyTuple_GET_SIZE(__pyx_args)) {
12484  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12485  CYTHON_FALLTHROUGH;
12486  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12487  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12488  break;
12489  default: goto __pyx_L5_argtuple_error;
12490  }
12491  }
12492  __pyx_v_obj = values[0];
12493  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
12494  if (values[2]) {
12495  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 346, __pyx_L3_error)
12496  } else {
12497  __pyx_v_dtype_is_object = ((int)0);
12498  }
12499  }
12500  goto __pyx_L4_argument_unpacking_done;
12501  __pyx_L5_argtuple_error:;
12502  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 346, __pyx_L3_error)
12503  __pyx_L3_error:;
12504  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12505  __Pyx_RefNannyFinishContext();
12506  return -1;
12507  __pyx_L4_argument_unpacking_done:;
12508  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
12509 
12510  /* function exit code */
12511  __Pyx_RefNannyFinishContext();
12512  return __pyx_r;
12513 }
12514 
12515 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
12516  int __pyx_r;
12517  __Pyx_TraceDeclarations
12518  __Pyx_RefNannyDeclarations
12519  int __pyx_t_1;
12520  int __pyx_t_2;
12521  int __pyx_t_3;
12522  int __pyx_t_4;
12523  int __pyx_lineno = 0;
12524  const char *__pyx_filename = NULL;
12525  int __pyx_clineno = 0;
12526  __Pyx_RefNannySetupContext("__cinit__", 0);
12527  __Pyx_TraceCall("__cinit__", __pyx_f[1], 346, 0, __PYX_ERR(1, 346, __pyx_L1_error));
12528 
12529  /* "View.MemoryView":347
12530  *
12531  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
12532  * self.obj = obj # <<<<<<<<<<<<<<
12533  * self.flags = flags
12534  * if type(self) is memoryview or obj is not None:
12535  */
12536  __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
12537  __Pyx_INCREF(__pyx_v_obj);
12538  __Pyx_GIVEREF(__pyx_v_obj);
12539  __Pyx_GOTREF(__pyx_v_self->obj);
12540  __Pyx_DECREF(__pyx_v_self->obj);
12541  __pyx_v_self->obj = __pyx_v_obj;
12542 
12543  /* "View.MemoryView":348
12544  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
12545  * self.obj = obj
12546  * self.flags = flags # <<<<<<<<<<<<<<
12547  * if type(self) is memoryview or obj is not None:
12548  * __Pyx_GetBuffer(obj, &self.view, flags)
12549  */
12550  __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
12551  __pyx_v_self->flags = __pyx_v_flags;
12552 
12553  /* "View.MemoryView":349
12554  * self.obj = obj
12555  * self.flags = flags
12556  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
12557  * __Pyx_GetBuffer(obj, &self.view, flags)
12558  * if <PyObject *> self.view.obj == NULL:
12559  */
12560  __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
12561  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
12562  __pyx_t_3 = (__pyx_t_2 != 0);
12563  if (!__pyx_t_3) {
12564  } else {
12565  __pyx_t_1 = __pyx_t_3;
12566  goto __pyx_L4_bool_binop_done;
12567  }
12568  __pyx_t_3 = (__pyx_v_obj != Py_None);
12569  __pyx_t_2 = (__pyx_t_3 != 0);
12570  __pyx_t_1 = __pyx_t_2;
12571  __pyx_L4_bool_binop_done:;
12572  if (__pyx_t_1) {
12573 
12574  /* "View.MemoryView":350
12575  * self.flags = flags
12576  * if type(self) is memoryview or obj is not None:
12577  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
12578  * if <PyObject *> self.view.obj == NULL:
12579  * (<__pyx_buffer *> &self.view).obj = Py_None
12580  */
12581  __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
12582  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 350, __pyx_L1_error)
12583 
12584  /* "View.MemoryView":351
12585  * if type(self) is memoryview or obj is not None:
12586  * __Pyx_GetBuffer(obj, &self.view, flags)
12587  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
12588  * (<__pyx_buffer *> &self.view).obj = Py_None
12589  * Py_INCREF(Py_None)
12590  */
12591  __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
12592  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
12593  if (__pyx_t_1) {
12594 
12595  /* "View.MemoryView":352
12596  * __Pyx_GetBuffer(obj, &self.view, flags)
12597  * if <PyObject *> self.view.obj == NULL:
12598  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
12599  * Py_INCREF(Py_None)
12600  *
12601  */
12602  __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
12603  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
12604 
12605  /* "View.MemoryView":353
12606  * if <PyObject *> self.view.obj == NULL:
12607  * (<__pyx_buffer *> &self.view).obj = Py_None
12608  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
12609  *
12610  * if not __PYX_CYTHON_ATOMICS_ENABLED():
12611  */
12612  __Pyx_TraceLine(353,0,__PYX_ERR(1, 353, __pyx_L1_error))
12613  Py_INCREF(Py_None);
12614 
12615  /* "View.MemoryView":351
12616  * if type(self) is memoryview or obj is not None:
12617  * __Pyx_GetBuffer(obj, &self.view, flags)
12618  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
12619  * (<__pyx_buffer *> &self.view).obj = Py_None
12620  * Py_INCREF(Py_None)
12621  */
12622  }
12623 
12624  /* "View.MemoryView":349
12625  * self.obj = obj
12626  * self.flags = flags
12627  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
12628  * __Pyx_GetBuffer(obj, &self.view, flags)
12629  * if <PyObject *> self.view.obj == NULL:
12630  */
12631  }
12632 
12633  /* "View.MemoryView":355
12634  * Py_INCREF(Py_None)
12635  *
12636  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
12637  * global __pyx_memoryview_thread_locks_used
12638  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
12639  */
12640  __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
12641  __pyx_t_1 = ((!(__PYX_CYTHON_ATOMICS_ENABLED() != 0)) != 0);
12642  if (__pyx_t_1) {
12643 
12644  /* "View.MemoryView":357
12645  * if not __PYX_CYTHON_ATOMICS_ENABLED():
12646  * global __pyx_memoryview_thread_locks_used
12647  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
12648  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
12649  * __pyx_memoryview_thread_locks_used += 1
12650  */
12651  __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
12652  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
12653  if (__pyx_t_1) {
12654 
12655  /* "View.MemoryView":358
12656  * global __pyx_memoryview_thread_locks_used
12657  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
12658  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
12659  * __pyx_memoryview_thread_locks_used += 1
12660  * if self.lock is NULL:
12661  */
12662  __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
12663  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
12664 
12665  /* "View.MemoryView":359
12666  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
12667  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
12668  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
12669  * if self.lock is NULL:
12670  * self.lock = PyThread_allocate_lock()
12671  */
12672  __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
12673  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
12674 
12675  /* "View.MemoryView":357
12676  * if not __PYX_CYTHON_ATOMICS_ENABLED():
12677  * global __pyx_memoryview_thread_locks_used
12678  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
12679  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
12680  * __pyx_memoryview_thread_locks_used += 1
12681  */
12682  }
12683 
12684  /* "View.MemoryView":360
12685  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
12686  * __pyx_memoryview_thread_locks_used += 1
12687  * if self.lock is NULL: # <<<<<<<<<<<<<<
12688  * self.lock = PyThread_allocate_lock()
12689  * if self.lock is NULL:
12690  */
12691  __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
12692  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
12693  if (__pyx_t_1) {
12694 
12695  /* "View.MemoryView":361
12696  * __pyx_memoryview_thread_locks_used += 1
12697  * if self.lock is NULL:
12698  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
12699  * if self.lock is NULL:
12700  * raise MemoryError
12701  */
12702  __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
12703  __pyx_v_self->lock = PyThread_allocate_lock();
12704 
12705  /* "View.MemoryView":362
12706  * if self.lock is NULL:
12707  * self.lock = PyThread_allocate_lock()
12708  * if self.lock is NULL: # <<<<<<<<<<<<<<
12709  * raise MemoryError
12710  *
12711  */
12712  __Pyx_TraceLine(362,0,__PYX_ERR(1, 362, __pyx_L1_error))
12713  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
12714  if (unlikely(__pyx_t_1)) {
12715 
12716  /* "View.MemoryView":363
12717  * self.lock = PyThread_allocate_lock()
12718  * if self.lock is NULL:
12719  * raise MemoryError # <<<<<<<<<<<<<<
12720  *
12721  * if flags & PyBUF_FORMAT:
12722  */
12723  __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
12724  PyErr_NoMemory(); __PYX_ERR(1, 363, __pyx_L1_error)
12725 
12726  /* "View.MemoryView":362
12727  * if self.lock is NULL:
12728  * self.lock = PyThread_allocate_lock()
12729  * if self.lock is NULL: # <<<<<<<<<<<<<<
12730  * raise MemoryError
12731  *
12732  */
12733  }
12734 
12735  /* "View.MemoryView":360
12736  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
12737  * __pyx_memoryview_thread_locks_used += 1
12738  * if self.lock is NULL: # <<<<<<<<<<<<<<
12739  * self.lock = PyThread_allocate_lock()
12740  * if self.lock is NULL:
12741  */
12742  }
12743 
12744  /* "View.MemoryView":355
12745  * Py_INCREF(Py_None)
12746  *
12747  * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
12748  * global __pyx_memoryview_thread_locks_used
12749  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
12750  */
12751  }
12752 
12753  /* "View.MemoryView":365
12754  * raise MemoryError
12755  *
12756  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12757  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
12758  * else:
12759  */
12760  __Pyx_TraceLine(365,0,__PYX_ERR(1, 365, __pyx_L1_error))
12761  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12762  if (__pyx_t_1) {
12763 
12764  /* "View.MemoryView":366
12765  *
12766  * if flags & PyBUF_FORMAT:
12767  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
12768  * else:
12769  * self.dtype_is_object = dtype_is_object
12770  */
12771  __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
12772  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
12773  if (__pyx_t_2) {
12774  } else {
12775  __pyx_t_1 = __pyx_t_2;
12776  goto __pyx_L12_bool_binop_done;
12777  }
12778  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
12779  __pyx_t_1 = __pyx_t_2;
12780  __pyx_L12_bool_binop_done:;
12781  __pyx_v_self->dtype_is_object = __pyx_t_1;
12782 
12783  /* "View.MemoryView":365
12784  * raise MemoryError
12785  *
12786  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12787  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
12788  * else:
12789  */
12790  goto __pyx_L11;
12791  }
12792 
12793  /* "View.MemoryView":368
12794  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
12795  * else:
12796  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
12797  *
12798  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
12799  */
12800  __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
12801  /*else*/ {
12802  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
12803  }
12804  __pyx_L11:;
12805 
12806  /* "View.MemoryView":370
12807  * self.dtype_is_object = dtype_is_object
12808  *
12809  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
12810  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
12811  * self.typeinfo = NULL
12812  */
12813  __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
12814  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
12815 
12816  /* "View.MemoryView":372
12817  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
12818  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
12819  * self.typeinfo = NULL # <<<<<<<<<<<<<<
12820  *
12821  * def __dealloc__(memoryview self):
12822  */
12823  __Pyx_TraceLine(372,0,__PYX_ERR(1, 372, __pyx_L1_error))
12824  __pyx_v_self->typeinfo = NULL;
12825 
12826  /* "View.MemoryView":346
12827  * cdef __Pyx_TypeInfo *typeinfo
12828  *
12829  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
12830  * self.obj = obj
12831  * self.flags = flags
12832  */
12833 
12834  /* function exit code */
12835  __pyx_r = 0;
12836  goto __pyx_L0;
12837  __pyx_L1_error:;
12838  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12839  __pyx_r = -1;
12840  __pyx_L0:;
12841  __Pyx_TraceReturn(Py_None, 0);
12842  __Pyx_RefNannyFinishContext();
12843  return __pyx_r;
12844 }
12845 
12846 /* "View.MemoryView":374
12847  * self.typeinfo = NULL
12848  *
12849  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
12850  * if self.obj is not None:
12851  * __Pyx_ReleaseBuffer(&self.view)
12852  */
12853 
12854 /* Python wrapper */
12855 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
12856 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
12857  __Pyx_RefNannyDeclarations
12858  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
12859  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12860 
12861  /* function exit code */
12862  __Pyx_RefNannyFinishContext();
12863 }
12864 
12865 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
12866  int __pyx_v_i;
12867  __Pyx_TraceDeclarations
12868  __Pyx_RefNannyDeclarations
12869  int __pyx_t_1;
12870  int __pyx_t_2;
12871  int __pyx_t_3;
12872  int __pyx_t_4;
12873  int __pyx_t_5;
12874  PyThread_type_lock __pyx_t_6;
12875  PyThread_type_lock __pyx_t_7;
12876  int __pyx_lineno = 0;
12877  const char *__pyx_filename = NULL;
12878  int __pyx_clineno = 0;
12879  __Pyx_RefNannySetupContext("__dealloc__", 0);
12880  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 374, 0, __PYX_ERR(1, 374, __pyx_L1_error));
12881 
12882  /* "View.MemoryView":375
12883  *
12884  * def __dealloc__(memoryview self):
12885  * if self.obj is not None: # <<<<<<<<<<<<<<
12886  * __Pyx_ReleaseBuffer(&self.view)
12887  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12888  */
12889  __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
12890  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
12891  __pyx_t_2 = (__pyx_t_1 != 0);
12892  if (__pyx_t_2) {
12893 
12894  /* "View.MemoryView":376
12895  * def __dealloc__(memoryview self):
12896  * if self.obj is not None:
12897  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
12898  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12899  *
12900  */
12901  __Pyx_TraceLine(376,0,__PYX_ERR(1, 376, __pyx_L1_error))
12902  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
12903 
12904  /* "View.MemoryView":375
12905  *
12906  * def __dealloc__(memoryview self):
12907  * if self.obj is not None: # <<<<<<<<<<<<<<
12908  * __Pyx_ReleaseBuffer(&self.view)
12909  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12910  */
12911  goto __pyx_L3;
12912  }
12913 
12914  /* "View.MemoryView":377
12915  * if self.obj is not None:
12916  * __Pyx_ReleaseBuffer(&self.view)
12917  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
12918  *
12919  * (<__pyx_buffer *> &self.view).obj = NULL
12920  */
12921  __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
12922  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
12923  if (__pyx_t_2) {
12924 
12925  /* "View.MemoryView":379
12926  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
12927  *
12928  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
12929  * Py_DECREF(Py_None)
12930  *
12931  */
12932  __Pyx_TraceLine(379,0,__PYX_ERR(1, 379, __pyx_L1_error))
12933  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
12934 
12935  /* "View.MemoryView":380
12936  *
12937  * (<__pyx_buffer *> &self.view).obj = NULL
12938  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
12939  *
12940  * cdef int i
12941  */
12942  __Pyx_TraceLine(380,0,__PYX_ERR(1, 380, __pyx_L1_error))
12943  Py_DECREF(Py_None);
12944 
12945  /* "View.MemoryView":377
12946  * if self.obj is not None:
12947  * __Pyx_ReleaseBuffer(&self.view)
12948  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
12949  *
12950  * (<__pyx_buffer *> &self.view).obj = NULL
12951  */
12952  }
12953  __pyx_L3:;
12954 
12955  /* "View.MemoryView":384
12956  * cdef int i
12957  * global __pyx_memoryview_thread_locks_used
12958  * if self.lock != NULL: # <<<<<<<<<<<<<<
12959  * for i in range(__pyx_memoryview_thread_locks_used):
12960  * if __pyx_memoryview_thread_locks[i] is self.lock:
12961  */
12962  __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
12963  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
12964  if (__pyx_t_2) {
12965 
12966  /* "View.MemoryView":385
12967  * global __pyx_memoryview_thread_locks_used
12968  * if self.lock != NULL:
12969  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
12970  * if __pyx_memoryview_thread_locks[i] is self.lock:
12971  * __pyx_memoryview_thread_locks_used -= 1
12972  */
12973  __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
12974  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
12975  __pyx_t_4 = __pyx_t_3;
12976  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
12977  __pyx_v_i = __pyx_t_5;
12978 
12979  /* "View.MemoryView":386
12980  * if self.lock != NULL:
12981  * for i in range(__pyx_memoryview_thread_locks_used):
12982  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
12983  * __pyx_memoryview_thread_locks_used -= 1
12984  * if i != __pyx_memoryview_thread_locks_used:
12985  */
12986  __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
12987  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
12988  if (__pyx_t_2) {
12989 
12990  /* "View.MemoryView":387
12991  * for i in range(__pyx_memoryview_thread_locks_used):
12992  * if __pyx_memoryview_thread_locks[i] is self.lock:
12993  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
12994  * if i != __pyx_memoryview_thread_locks_used:
12995  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
12996  */
12997  __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
12998  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
12999 
13000  /* "View.MemoryView":388
13001  * if __pyx_memoryview_thread_locks[i] is self.lock:
13002  * __pyx_memoryview_thread_locks_used -= 1
13003  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
13004  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
13005  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
13006  */
13007  __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
13008  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
13009  if (__pyx_t_2) {
13010 
13011  /* "View.MemoryView":390
13012  * if i != __pyx_memoryview_thread_locks_used:
13013  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
13014  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
13015  * break
13016  * else:
13017  */
13018  __Pyx_TraceLine(390,0,__PYX_ERR(1, 390, __pyx_L1_error))
13019  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
13020  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
13021 
13022  /* "View.MemoryView":389
13023  * __pyx_memoryview_thread_locks_used -= 1
13024  * if i != __pyx_memoryview_thread_locks_used:
13025  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
13026  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
13027  * break
13028  */
13029  __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
13030  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
13031  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
13032 
13033  /* "View.MemoryView":388
13034  * if __pyx_memoryview_thread_locks[i] is self.lock:
13035  * __pyx_memoryview_thread_locks_used -= 1
13036  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
13037  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
13038  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
13039  */
13040  }
13041 
13042  /* "View.MemoryView":391
13043  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
13044  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
13045  * break # <<<<<<<<<<<<<<
13046  * else:
13047  * PyThread_free_lock(self.lock)
13048  */
13049  __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
13050  goto __pyx_L6_break;
13051 
13052  /* "View.MemoryView":386
13053  * if self.lock != NULL:
13054  * for i in range(__pyx_memoryview_thread_locks_used):
13055  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
13056  * __pyx_memoryview_thread_locks_used -= 1
13057  * if i != __pyx_memoryview_thread_locks_used:
13058  */
13059  }
13060  }
13061  /*else*/ {
13062 
13063  /* "View.MemoryView":393
13064  * break
13065  * else:
13066  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
13067  *
13068  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
13069  */
13070  __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
13071  PyThread_free_lock(__pyx_v_self->lock);
13072  }
13073  __pyx_L6_break:;
13074 
13075  /* "View.MemoryView":384
13076  * cdef int i
13077  * global __pyx_memoryview_thread_locks_used
13078  * if self.lock != NULL: # <<<<<<<<<<<<<<
13079  * for i in range(__pyx_memoryview_thread_locks_used):
13080  * if __pyx_memoryview_thread_locks[i] is self.lock:
13081  */
13082  }
13083 
13084  /* "View.MemoryView":374
13085  * self.typeinfo = NULL
13086  *
13087  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
13088  * if self.obj is not None:
13089  * __Pyx_ReleaseBuffer(&self.view)
13090  */
13091 
13092  /* function exit code */
13093  goto __pyx_L0;
13094  __pyx_L1_error:;
13095  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13096  __pyx_L0:;
13097  __Pyx_TraceReturn(Py_None, 0);
13098  __Pyx_RefNannyFinishContext();
13099 }
13100 
13101 /* "View.MemoryView":395
13102  * PyThread_free_lock(self.lock)
13103  *
13104  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
13105  * cdef Py_ssize_t dim
13106  * cdef char *itemp = <char *> self.view.buf
13107  */
13108 
13109 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
13110  Py_ssize_t __pyx_v_dim;
13111  char *__pyx_v_itemp;
13112  PyObject *__pyx_v_idx = NULL;
13113  char *__pyx_r;
13114  __Pyx_TraceDeclarations
13115  __Pyx_RefNannyDeclarations
13116  Py_ssize_t __pyx_t_1;
13117  PyObject *__pyx_t_2 = NULL;
13118  Py_ssize_t __pyx_t_3;
13119  PyObject *(*__pyx_t_4)(PyObject *);
13120  PyObject *__pyx_t_5 = NULL;
13121  Py_ssize_t __pyx_t_6;
13122  char *__pyx_t_7;
13123  int __pyx_lineno = 0;
13124  const char *__pyx_filename = NULL;
13125  int __pyx_clineno = 0;
13126  __Pyx_RefNannySetupContext("get_item_pointer", 0);
13127  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 395, 0, __PYX_ERR(1, 395, __pyx_L1_error));
13128 
13129  /* "View.MemoryView":397
13130  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
13131  * cdef Py_ssize_t dim
13132  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
13133  *
13134  * for dim, idx in enumerate(index):
13135  */
13136  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
13137  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
13138 
13139  /* "View.MemoryView":399
13140  * cdef char *itemp = <char *> self.view.buf
13141  *
13142  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
13143  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
13144  *
13145  */
13146  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
13147  __pyx_t_1 = 0;
13148  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
13149  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
13150  __pyx_t_4 = NULL;
13151  } else {
13152  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 399, __pyx_L1_error)
13153  __Pyx_GOTREF(__pyx_t_2);
13154  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
13155  }
13156  for (;;) {
13157  if (likely(!__pyx_t_4)) {
13158  if (likely(PyList_CheckExact(__pyx_t_2))) {
13159  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
13160  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13161  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
13162  #else
13163  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
13164  __Pyx_GOTREF(__pyx_t_5);
13165  #endif
13166  } else {
13167  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
13168  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13169  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 399, __pyx_L1_error)
13170  #else
13171  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
13172  __Pyx_GOTREF(__pyx_t_5);
13173  #endif
13174  }
13175  } else {
13176  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
13177  if (unlikely(!__pyx_t_5)) {
13178  PyObject* exc_type = PyErr_Occurred();
13179  if (exc_type) {
13180  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13181  else __PYX_ERR(1, 399, __pyx_L1_error)
13182  }
13183  break;
13184  }
13185  __Pyx_GOTREF(__pyx_t_5);
13186  }
13187  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
13188  __pyx_t_5 = 0;
13189  __pyx_v_dim = __pyx_t_1;
13190  __pyx_t_1 = (__pyx_t_1 + 1);
13191 
13192  /* "View.MemoryView":400
13193  *
13194  * for dim, idx in enumerate(index):
13195  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
13196  *
13197  * return itemp
13198  */
13199  __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
13200  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 400, __pyx_L1_error)
13201  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 400, __pyx_L1_error)
13202  __pyx_v_itemp = __pyx_t_7;
13203 
13204  /* "View.MemoryView":399
13205  * cdef char *itemp = <char *> self.view.buf
13206  *
13207  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
13208  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
13209  *
13210  */
13211  __Pyx_TraceLine(399,0,__PYX_ERR(1, 399, __pyx_L1_error))
13212  }
13213  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13214 
13215  /* "View.MemoryView":402
13216  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
13217  *
13218  * return itemp # <<<<<<<<<<<<<<
13219  *
13220  *
13221  */
13222  __Pyx_TraceLine(402,0,__PYX_ERR(1, 402, __pyx_L1_error))
13223  __pyx_r = __pyx_v_itemp;
13224  goto __pyx_L0;
13225 
13226  /* "View.MemoryView":395
13227  * PyThread_free_lock(self.lock)
13228  *
13229  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
13230  * cdef Py_ssize_t dim
13231  * cdef char *itemp = <char *> self.view.buf
13232  */
13233 
13234  /* function exit code */
13235  __pyx_L1_error:;
13236  __Pyx_XDECREF(__pyx_t_2);
13237  __Pyx_XDECREF(__pyx_t_5);
13238  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
13239  __pyx_r = NULL;
13240  __pyx_L0:;
13241  __Pyx_XDECREF(__pyx_v_idx);
13242  __Pyx_TraceReturn(Py_None, 0);
13243  __Pyx_RefNannyFinishContext();
13244  return __pyx_r;
13245 }
13246 
13247 /* "View.MemoryView":405
13248  *
13249  *
13250  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
13251  * if index is Ellipsis:
13252  * return self
13253  */
13254 
13255 /* Python wrapper */
13256 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
13257 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
13258  PyObject *__pyx_r = 0;
13259  __Pyx_RefNannyDeclarations
13260  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
13261  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
13262 
13263  /* function exit code */
13264  __Pyx_RefNannyFinishContext();
13265  return __pyx_r;
13266 }
13267 
13268 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
13269  PyObject *__pyx_v_have_slices = NULL;
13270  PyObject *__pyx_v_indices = NULL;
13271  char *__pyx_v_itemp;
13272  PyObject *__pyx_r = NULL;
13273  __Pyx_TraceDeclarations
13274  __Pyx_RefNannyDeclarations
13275  int __pyx_t_1;
13276  int __pyx_t_2;
13277  PyObject *__pyx_t_3 = NULL;
13278  PyObject *__pyx_t_4 = NULL;
13279  PyObject *__pyx_t_5 = NULL;
13280  char *__pyx_t_6;
13281  int __pyx_lineno = 0;
13282  const char *__pyx_filename = NULL;
13283  int __pyx_clineno = 0;
13284  __Pyx_RefNannySetupContext("__getitem__", 0);
13285  __Pyx_TraceCall("__getitem__", __pyx_f[1], 405, 0, __PYX_ERR(1, 405, __pyx_L1_error));
13286 
13287  /* "View.MemoryView":406
13288  *
13289  * def __getitem__(memoryview self, object index):
13290  * if index is Ellipsis: # <<<<<<<<<<<<<<
13291  * return self
13292  *
13293  */
13294  __Pyx_TraceLine(406,0,__PYX_ERR(1, 406, __pyx_L1_error))
13295  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
13296  __pyx_t_2 = (__pyx_t_1 != 0);
13297  if (__pyx_t_2) {
13298 
13299  /* "View.MemoryView":407
13300  * def __getitem__(memoryview self, object index):
13301  * if index is Ellipsis:
13302  * return self # <<<<<<<<<<<<<<
13303  *
13304  * have_slices, indices = _unellipsify(index, self.view.ndim)
13305  */
13306  __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
13307  __Pyx_XDECREF(__pyx_r);
13308  __Pyx_INCREF(((PyObject *)__pyx_v_self));
13309  __pyx_r = ((PyObject *)__pyx_v_self);
13310  goto __pyx_L0;
13311 
13312  /* "View.MemoryView":406
13313  *
13314  * def __getitem__(memoryview self, object index):
13315  * if index is Ellipsis: # <<<<<<<<<<<<<<
13316  * return self
13317  *
13318  */
13319  }
13320 
13321  /* "View.MemoryView":409
13322  * return self
13323  *
13324  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
13325  *
13326  * cdef char *itemp
13327  */
13328  __Pyx_TraceLine(409,0,__PYX_ERR(1, 409, __pyx_L1_error))
13329  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __pyx_L1_error)
13330  __Pyx_GOTREF(__pyx_t_3);
13331  if (likely(__pyx_t_3 != Py_None)) {
13332  PyObject* sequence = __pyx_t_3;
13333  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
13334  if (unlikely(size != 2)) {
13335  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
13336  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
13337  __PYX_ERR(1, 409, __pyx_L1_error)
13338  }
13339  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13340  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
13341  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
13342  __Pyx_INCREF(__pyx_t_4);
13343  __Pyx_INCREF(__pyx_t_5);
13344  #else
13345  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 409, __pyx_L1_error)
13346  __Pyx_GOTREF(__pyx_t_4);
13347  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 409, __pyx_L1_error)
13348  __Pyx_GOTREF(__pyx_t_5);
13349  #endif
13350  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13351  } else {
13352  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __pyx_L1_error)
13353  }
13354  __pyx_v_have_slices = __pyx_t_4;
13355  __pyx_t_4 = 0;
13356  __pyx_v_indices = __pyx_t_5;
13357  __pyx_t_5 = 0;
13358 
13359  /* "View.MemoryView":412
13360  *
13361  * cdef char *itemp
13362  * if have_slices: # <<<<<<<<<<<<<<
13363  * return memview_slice(self, indices)
13364  * else:
13365  */
13366  __Pyx_TraceLine(412,0,__PYX_ERR(1, 412, __pyx_L1_error))
13367  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 412, __pyx_L1_error)
13368  if (__pyx_t_2) {
13369 
13370  /* "View.MemoryView":413
13371  * cdef char *itemp
13372  * if have_slices:
13373  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
13374  * else:
13375  * itemp = self.get_item_pointer(indices)
13376  */
13377  __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
13378  __Pyx_XDECREF(__pyx_r);
13379  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 413, __pyx_L1_error)
13380  __Pyx_GOTREF(__pyx_t_3);
13381  __pyx_r = __pyx_t_3;
13382  __pyx_t_3 = 0;
13383  goto __pyx_L0;
13384 
13385  /* "View.MemoryView":412
13386  *
13387  * cdef char *itemp
13388  * if have_slices: # <<<<<<<<<<<<<<
13389  * return memview_slice(self, indices)
13390  * else:
13391  */
13392  }
13393 
13394  /* "View.MemoryView":415
13395  * return memview_slice(self, indices)
13396  * else:
13397  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
13398  * return self.convert_item_to_object(itemp)
13399  *
13400  */
13401  __Pyx_TraceLine(415,0,__PYX_ERR(1, 415, __pyx_L1_error))
13402  /*else*/ {
13403  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 415, __pyx_L1_error)
13404  __pyx_v_itemp = __pyx_t_6;
13405 
13406  /* "View.MemoryView":416
13407  * else:
13408  * itemp = self.get_item_pointer(indices)
13409  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
13410  *
13411  * def __setitem__(memoryview self, object index, object value):
13412  */
13413  __Pyx_TraceLine(416,0,__PYX_ERR(1, 416, __pyx_L1_error))
13414  __Pyx_XDECREF(__pyx_r);
13415  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __pyx_L1_error)
13416  __Pyx_GOTREF(__pyx_t_3);
13417  __pyx_r = __pyx_t_3;
13418  __pyx_t_3 = 0;
13419  goto __pyx_L0;
13420  }
13421 
13422  /* "View.MemoryView":405
13423  *
13424  *
13425  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
13426  * if index is Ellipsis:
13427  * return self
13428  */
13429 
13430  /* function exit code */
13431  __pyx_L1_error:;
13432  __Pyx_XDECREF(__pyx_t_3);
13433  __Pyx_XDECREF(__pyx_t_4);
13434  __Pyx_XDECREF(__pyx_t_5);
13435  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13436  __pyx_r = NULL;
13437  __pyx_L0:;
13438  __Pyx_XDECREF(__pyx_v_have_slices);
13439  __Pyx_XDECREF(__pyx_v_indices);
13440  __Pyx_XGIVEREF(__pyx_r);
13441  __Pyx_TraceReturn(__pyx_r, 0);
13442  __Pyx_RefNannyFinishContext();
13443  return __pyx_r;
13444 }
13445 
13446 /* "View.MemoryView":418
13447  * return self.convert_item_to_object(itemp)
13448  *
13449  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
13450  * if self.view.readonly:
13451  * raise TypeError("Cannot assign to read-only memoryview")
13452  */
13453 
13454 /* Python wrapper */
13455 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
13456 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13457  int __pyx_r;
13458  __Pyx_RefNannyDeclarations
13459  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
13460  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
13461 
13462  /* function exit code */
13463  __Pyx_RefNannyFinishContext();
13464  return __pyx_r;
13465 }
13466 
13467 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
13468  PyObject *__pyx_v_have_slices = NULL;
13469  PyObject *__pyx_v_obj = NULL;
13470  int __pyx_r;
13471  __Pyx_TraceDeclarations
13472  __Pyx_RefNannyDeclarations
13473  int __pyx_t_1;
13474  PyObject *__pyx_t_2 = NULL;
13475  PyObject *__pyx_t_3 = NULL;
13476  PyObject *__pyx_t_4 = NULL;
13477  int __pyx_lineno = 0;
13478  const char *__pyx_filename = NULL;
13479  int __pyx_clineno = 0;
13480  __Pyx_RefNannySetupContext("__setitem__", 0);
13481  __Pyx_TraceCall("__setitem__", __pyx_f[1], 418, 0, __PYX_ERR(1, 418, __pyx_L1_error));
13482  __Pyx_INCREF(__pyx_v_index);
13483 
13484  /* "View.MemoryView":419
13485  *
13486  * def __setitem__(memoryview self, object index, object value):
13487  * if self.view.readonly: # <<<<<<<<<<<<<<
13488  * raise TypeError("Cannot assign to read-only memoryview")
13489  *
13490  */
13491  __Pyx_TraceLine(419,0,__PYX_ERR(1, 419, __pyx_L1_error))
13492  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
13493  if (unlikely(__pyx_t_1)) {
13494 
13495  /* "View.MemoryView":420
13496  * def __setitem__(memoryview self, object index, object value):
13497  * if self.view.readonly:
13498  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
13499  *
13500  * have_slices, index = _unellipsify(index, self.view.ndim)
13501  */
13502  __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
13503  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
13504  __Pyx_GOTREF(__pyx_t_2);
13505  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13506  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13507  __PYX_ERR(1, 420, __pyx_L1_error)
13508 
13509  /* "View.MemoryView":419
13510  *
13511  * def __setitem__(memoryview self, object index, object value):
13512  * if self.view.readonly: # <<<<<<<<<<<<<<
13513  * raise TypeError("Cannot assign to read-only memoryview")
13514  *
13515  */
13516  }
13517 
13518  /* "View.MemoryView":422
13519  * raise TypeError("Cannot assign to read-only memoryview")
13520  *
13521  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
13522  *
13523  * if have_slices:
13524  */
13525  __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
13526  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 422, __pyx_L1_error)
13527  __Pyx_GOTREF(__pyx_t_2);
13528  if (likely(__pyx_t_2 != Py_None)) {
13529  PyObject* sequence = __pyx_t_2;
13530  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
13531  if (unlikely(size != 2)) {
13532  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
13533  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
13534  __PYX_ERR(1, 422, __pyx_L1_error)
13535  }
13536  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13537  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
13538  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
13539  __Pyx_INCREF(__pyx_t_3);
13540  __Pyx_INCREF(__pyx_t_4);
13541  #else
13542  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 422, __pyx_L1_error)
13543  __Pyx_GOTREF(__pyx_t_3);
13544  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 422, __pyx_L1_error)
13545  __Pyx_GOTREF(__pyx_t_4);
13546  #endif
13547  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13548  } else {
13549  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 422, __pyx_L1_error)
13550  }
13551  __pyx_v_have_slices = __pyx_t_3;
13552  __pyx_t_3 = 0;
13553  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
13554  __pyx_t_4 = 0;
13555 
13556  /* "View.MemoryView":424
13557  * have_slices, index = _unellipsify(index, self.view.ndim)
13558  *
13559  * if have_slices: # <<<<<<<<<<<<<<
13560  * obj = self.is_slice(value)
13561  * if obj:
13562  */
13563  __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
13564  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
13565  if (__pyx_t_1) {
13566 
13567  /* "View.MemoryView":425
13568  *
13569  * if have_slices:
13570  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
13571  * if obj:
13572  * self.setitem_slice_assignment(self[index], obj)
13573  */
13574  __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
13575  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
13576  __Pyx_GOTREF(__pyx_t_2);
13577  __pyx_v_obj = __pyx_t_2;
13578  __pyx_t_2 = 0;
13579 
13580  /* "View.MemoryView":426
13581  * if have_slices:
13582  * obj = self.is_slice(value)
13583  * if obj: # <<<<<<<<<<<<<<
13584  * self.setitem_slice_assignment(self[index], obj)
13585  * else:
13586  */
13587  __Pyx_TraceLine(426,0,__PYX_ERR(1, 426, __pyx_L1_error))
13588  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 426, __pyx_L1_error)
13589  if (__pyx_t_1) {
13590 
13591  /* "View.MemoryView":427
13592  * obj = self.is_slice(value)
13593  * if obj:
13594  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
13595  * else:
13596  * self.setitem_slice_assign_scalar(self[index], value)
13597  */
13598  __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
13599  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
13600  __Pyx_GOTREF(__pyx_t_2);
13601  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
13602  __Pyx_GOTREF(__pyx_t_4);
13603  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13604  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13605 
13606  /* "View.MemoryView":426
13607  * if have_slices:
13608  * obj = self.is_slice(value)
13609  * if obj: # <<<<<<<<<<<<<<
13610  * self.setitem_slice_assignment(self[index], obj)
13611  * else:
13612  */
13613  goto __pyx_L5;
13614  }
13615 
13616  /* "View.MemoryView":429
13617  * self.setitem_slice_assignment(self[index], obj)
13618  * else:
13619  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
13620  * else:
13621  * self.setitem_indexed(index, value)
13622  */
13623  __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
13624  /*else*/ {
13625  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 429, __pyx_L1_error)
13626  __Pyx_GOTREF(__pyx_t_4);
13627  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 429, __pyx_L1_error)
13628  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
13629  __Pyx_GOTREF(__pyx_t_2);
13630  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13631  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13632  }
13633  __pyx_L5:;
13634 
13635  /* "View.MemoryView":424
13636  * have_slices, index = _unellipsify(index, self.view.ndim)
13637  *
13638  * if have_slices: # <<<<<<<<<<<<<<
13639  * obj = self.is_slice(value)
13640  * if obj:
13641  */
13642  goto __pyx_L4;
13643  }
13644 
13645  /* "View.MemoryView":431
13646  * self.setitem_slice_assign_scalar(self[index], value)
13647  * else:
13648  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
13649  *
13650  * cdef is_slice(self, obj):
13651  */
13652  __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
13653  /*else*/ {
13654  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 431, __pyx_L1_error)
13655  __Pyx_GOTREF(__pyx_t_2);
13656  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13657  }
13658  __pyx_L4:;
13659 
13660  /* "View.MemoryView":418
13661  * return self.convert_item_to_object(itemp)
13662  *
13663  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
13664  * if self.view.readonly:
13665  * raise TypeError("Cannot assign to read-only memoryview")
13666  */
13667 
13668  /* function exit code */
13669  __pyx_r = 0;
13670  goto __pyx_L0;
13671  __pyx_L1_error:;
13672  __Pyx_XDECREF(__pyx_t_2);
13673  __Pyx_XDECREF(__pyx_t_3);
13674  __Pyx_XDECREF(__pyx_t_4);
13675  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13676  __pyx_r = -1;
13677  __pyx_L0:;
13678  __Pyx_XDECREF(__pyx_v_have_slices);
13679  __Pyx_XDECREF(__pyx_v_obj);
13680  __Pyx_XDECREF(__pyx_v_index);
13681  __Pyx_TraceReturn(Py_None, 0);
13682  __Pyx_RefNannyFinishContext();
13683  return __pyx_r;
13684 }
13685 
13686 /* "View.MemoryView":433
13687  * self.setitem_indexed(index, value)
13688  *
13689  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
13690  * if not isinstance(obj, memoryview):
13691  * try:
13692  */
13693 
13694 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
13695  PyObject *__pyx_r = NULL;
13696  __Pyx_TraceDeclarations
13697  __Pyx_RefNannyDeclarations
13698  int __pyx_t_1;
13699  int __pyx_t_2;
13700  PyObject *__pyx_t_3 = NULL;
13701  PyObject *__pyx_t_4 = NULL;
13702  PyObject *__pyx_t_5 = NULL;
13703  PyObject *__pyx_t_6 = NULL;
13704  PyObject *__pyx_t_7 = NULL;
13705  PyObject *__pyx_t_8 = NULL;
13706  int __pyx_t_9;
13707  int __pyx_lineno = 0;
13708  const char *__pyx_filename = NULL;
13709  int __pyx_clineno = 0;
13710  __Pyx_RefNannySetupContext("is_slice", 0);
13711  __Pyx_TraceCall("is_slice", __pyx_f[1], 433, 0, __PYX_ERR(1, 433, __pyx_L1_error));
13712  __Pyx_INCREF(__pyx_v_obj);
13713 
13714  /* "View.MemoryView":434
13715  *
13716  * cdef is_slice(self, obj):
13717  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
13718  * try:
13719  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
13720  */
13721  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L1_error))
13722  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
13723  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
13724  if (__pyx_t_2) {
13725 
13726  /* "View.MemoryView":435
13727  * cdef is_slice(self, obj):
13728  * if not isinstance(obj, memoryview):
13729  * try: # <<<<<<<<<<<<<<
13730  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
13731  * self.dtype_is_object)
13732  */
13733  __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L1_error))
13734  {
13735  __Pyx_PyThreadState_declare
13736  __Pyx_PyThreadState_assign
13737  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
13738  __Pyx_XGOTREF(__pyx_t_3);
13739  __Pyx_XGOTREF(__pyx_t_4);
13740  __Pyx_XGOTREF(__pyx_t_5);
13741  /*try:*/ {
13742 
13743  /* "View.MemoryView":436
13744  * if not isinstance(obj, memoryview):
13745  * try:
13746  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
13747  * self.dtype_is_object)
13748  * except TypeError:
13749  */
13750  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
13751  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 436, __pyx_L4_error)
13752  __Pyx_GOTREF(__pyx_t_6);
13753 
13754  /* "View.MemoryView":437
13755  * try:
13756  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
13757  * self.dtype_is_object) # <<<<<<<<<<<<<<
13758  * except TypeError:
13759  * return None
13760  */
13761  __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L4_error))
13762  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 437, __pyx_L4_error)
13763  __Pyx_GOTREF(__pyx_t_7);
13764 
13765  /* "View.MemoryView":436
13766  * if not isinstance(obj, memoryview):
13767  * try:
13768  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
13769  * self.dtype_is_object)
13770  * except TypeError:
13771  */
13772  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L4_error))
13773  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 436, __pyx_L4_error)
13774  __Pyx_GOTREF(__pyx_t_8);
13775  __Pyx_INCREF(__pyx_v_obj);
13776  __Pyx_GIVEREF(__pyx_v_obj);
13777  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
13778  __Pyx_GIVEREF(__pyx_t_6);
13779  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
13780  __Pyx_GIVEREF(__pyx_t_7);
13781  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
13782  __pyx_t_6 = 0;
13783  __pyx_t_7 = 0;
13784  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 436, __pyx_L4_error)
13785  __Pyx_GOTREF(__pyx_t_7);
13786  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13787  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
13788  __pyx_t_7 = 0;
13789 
13790  /* "View.MemoryView":435
13791  * cdef is_slice(self, obj):
13792  * if not isinstance(obj, memoryview):
13793  * try: # <<<<<<<<<<<<<<
13794  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
13795  * self.dtype_is_object)
13796  */
13797  }
13798  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13799  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13800  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13801  goto __pyx_L9_try_end;
13802  __pyx_L4_error:;
13803  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13804  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13805  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13806 
13807  /* "View.MemoryView":438
13808  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
13809  * self.dtype_is_object)
13810  * except TypeError: # <<<<<<<<<<<<<<
13811  * return None
13812  *
13813  */
13814  __Pyx_TraceLine(438,0,__PYX_ERR(1, 438, __pyx_L6_except_error))
13815  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
13816  if (__pyx_t_9) {
13817  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13818  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 438, __pyx_L6_except_error)
13819  __Pyx_GOTREF(__pyx_t_7);
13820  __Pyx_GOTREF(__pyx_t_8);
13821  __Pyx_GOTREF(__pyx_t_6);
13822 
13823  /* "View.MemoryView":439
13824  * self.dtype_is_object)
13825  * except TypeError:
13826  * return None # <<<<<<<<<<<<<<
13827  *
13828  * return obj
13829  */
13830  __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L6_except_error))
13831  __Pyx_XDECREF(__pyx_r);
13832  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13833  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13834  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13835  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13836  goto __pyx_L7_except_return;
13837  }
13838  goto __pyx_L6_except_error;
13839  __pyx_L6_except_error:;
13840 
13841  /* "View.MemoryView":435
13842  * cdef is_slice(self, obj):
13843  * if not isinstance(obj, memoryview):
13844  * try: # <<<<<<<<<<<<<<
13845  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
13846  * self.dtype_is_object)
13847  */
13848  __Pyx_XGIVEREF(__pyx_t_3);
13849  __Pyx_XGIVEREF(__pyx_t_4);
13850  __Pyx_XGIVEREF(__pyx_t_5);
13851  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
13852  goto __pyx_L1_error;
13853  __pyx_L7_except_return:;
13854  __Pyx_XGIVEREF(__pyx_t_3);
13855  __Pyx_XGIVEREF(__pyx_t_4);
13856  __Pyx_XGIVEREF(__pyx_t_5);
13857  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
13858  goto __pyx_L0;
13859  __pyx_L9_try_end:;
13860  }
13861 
13862  /* "View.MemoryView":434
13863  *
13864  * cdef is_slice(self, obj):
13865  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
13866  * try:
13867  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
13868  */
13869  }
13870 
13871  /* "View.MemoryView":441
13872  * return None
13873  *
13874  * return obj # <<<<<<<<<<<<<<
13875  *
13876  * cdef setitem_slice_assignment(self, dst, src):
13877  */
13878  __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
13879  __Pyx_XDECREF(__pyx_r);
13880  __Pyx_INCREF(__pyx_v_obj);
13881  __pyx_r = __pyx_v_obj;
13882  goto __pyx_L0;
13883 
13884  /* "View.MemoryView":433
13885  * self.setitem_indexed(index, value)
13886  *
13887  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
13888  * if not isinstance(obj, memoryview):
13889  * try:
13890  */
13891 
13892  /* function exit code */
13893  __pyx_L1_error:;
13894  __Pyx_XDECREF(__pyx_t_6);
13895  __Pyx_XDECREF(__pyx_t_7);
13896  __Pyx_XDECREF(__pyx_t_8);
13897  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13898  __pyx_r = 0;
13899  __pyx_L0:;
13900  __Pyx_XDECREF(__pyx_v_obj);
13901  __Pyx_XGIVEREF(__pyx_r);
13902  __Pyx_TraceReturn(__pyx_r, 0);
13903  __Pyx_RefNannyFinishContext();
13904  return __pyx_r;
13905 }
13906 
13907 /* "View.MemoryView":443
13908  * return obj
13909  *
13910  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
13911  * cdef __Pyx_memviewslice dst_slice
13912  * cdef __Pyx_memviewslice src_slice
13913  */
13914 
13915 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
13916  __Pyx_memviewslice __pyx_v_dst_slice;
13917  __Pyx_memviewslice __pyx_v_src_slice;
13918  PyObject *__pyx_r = NULL;
13919  __Pyx_TraceDeclarations
13920  __Pyx_RefNannyDeclarations
13921  __Pyx_memviewslice *__pyx_t_1;
13922  __Pyx_memviewslice *__pyx_t_2;
13923  PyObject *__pyx_t_3 = NULL;
13924  int __pyx_t_4;
13925  int __pyx_t_5;
13926  int __pyx_t_6;
13927  int __pyx_lineno = 0;
13928  const char *__pyx_filename = NULL;
13929  int __pyx_clineno = 0;
13930  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
13931  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 443, 0, __PYX_ERR(1, 443, __pyx_L1_error));
13932 
13933  /* "View.MemoryView":447
13934  * cdef __Pyx_memviewslice src_slice
13935  *
13936  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
13937  * get_slice_from_memview(dst, &dst_slice)[0],
13938  * src.ndim, dst.ndim, self.dtype_is_object)
13939  */
13940  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
13941  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 447, __pyx_L1_error)
13942  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 447, __pyx_L1_error)
13943 
13944  /* "View.MemoryView":448
13945  *
13946  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
13947  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
13948  * src.ndim, dst.ndim, self.dtype_is_object)
13949  *
13950  */
13951  __Pyx_TraceLine(448,0,__PYX_ERR(1, 448, __pyx_L1_error))
13952  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
13953  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
13954 
13955  /* "View.MemoryView":449
13956  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
13957  * get_slice_from_memview(dst, &dst_slice)[0],
13958  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
13959  *
13960  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
13961  */
13962  __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
13963  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
13964  __Pyx_GOTREF(__pyx_t_3);
13965  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
13966  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13967  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 449, __pyx_L1_error)
13968  __Pyx_GOTREF(__pyx_t_3);
13969  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 449, __pyx_L1_error)
13970  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13971 
13972  /* "View.MemoryView":447
13973  * cdef __Pyx_memviewslice src_slice
13974  *
13975  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
13976  * get_slice_from_memview(dst, &dst_slice)[0],
13977  * src.ndim, dst.ndim, self.dtype_is_object)
13978  */
13979  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
13980  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 447, __pyx_L1_error)
13981 
13982  /* "View.MemoryView":443
13983  * return obj
13984  *
13985  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
13986  * cdef __Pyx_memviewslice dst_slice
13987  * cdef __Pyx_memviewslice src_slice
13988  */
13989 
13990  /* function exit code */
13991  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13992  goto __pyx_L0;
13993  __pyx_L1_error:;
13994  __Pyx_XDECREF(__pyx_t_3);
13995  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
13996  __pyx_r = 0;
13997  __pyx_L0:;
13998  __Pyx_XGIVEREF(__pyx_r);
13999  __Pyx_TraceReturn(__pyx_r, 0);
14000  __Pyx_RefNannyFinishContext();
14001  return __pyx_r;
14002 }
14003 
14004 /* "View.MemoryView":451
14005  * src.ndim, dst.ndim, self.dtype_is_object)
14006  *
14007  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
14008  * cdef int array[128]
14009  * cdef void *tmp = NULL
14010  */
14011 
14012 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
14013  int __pyx_v_array[0x80];
14014  void *__pyx_v_tmp;
14015  void *__pyx_v_item;
14016  __Pyx_memviewslice *__pyx_v_dst_slice;
14017  __Pyx_memviewslice __pyx_v_tmp_slice;
14018  PyObject *__pyx_r = NULL;
14019  __Pyx_TraceDeclarations
14020  __Pyx_RefNannyDeclarations
14021  __Pyx_memviewslice *__pyx_t_1;
14022  int __pyx_t_2;
14023  PyObject *__pyx_t_3 = NULL;
14024  int __pyx_t_4;
14025  int __pyx_t_5;
14026  char const *__pyx_t_6;
14027  PyObject *__pyx_t_7 = NULL;
14028  PyObject *__pyx_t_8 = NULL;
14029  PyObject *__pyx_t_9 = NULL;
14030  PyObject *__pyx_t_10 = NULL;
14031  PyObject *__pyx_t_11 = NULL;
14032  PyObject *__pyx_t_12 = NULL;
14033  int __pyx_lineno = 0;
14034  const char *__pyx_filename = NULL;
14035  int __pyx_clineno = 0;
14036  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
14037  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 451, 0, __PYX_ERR(1, 451, __pyx_L1_error));
14038 
14039  /* "View.MemoryView":453
14040  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
14041  * cdef int array[128]
14042  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
14043  * cdef void *item
14044  *
14045  */
14046  __Pyx_TraceLine(453,0,__PYX_ERR(1, 453, __pyx_L1_error))
14047  __pyx_v_tmp = NULL;
14048 
14049  /* "View.MemoryView":458
14050  * cdef __Pyx_memviewslice *dst_slice
14051  * cdef __Pyx_memviewslice tmp_slice
14052  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
14053  *
14054  * if <size_t>self.view.itemsize > sizeof(array):
14055  */
14056  __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
14057  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 458, __pyx_L1_error)
14058  __pyx_v_dst_slice = __pyx_t_1;
14059 
14060  /* "View.MemoryView":460
14061  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
14062  *
14063  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
14064  * tmp = PyMem_Malloc(self.view.itemsize)
14065  * if tmp == NULL:
14066  */
14067  __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
14068  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
14069  if (__pyx_t_2) {
14070 
14071  /* "View.MemoryView":461
14072  *
14073  * if <size_t>self.view.itemsize > sizeof(array):
14074  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
14075  * if tmp == NULL:
14076  * raise MemoryError
14077  */
14078  __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
14079  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
14080 
14081  /* "View.MemoryView":462
14082  * if <size_t>self.view.itemsize > sizeof(array):
14083  * tmp = PyMem_Malloc(self.view.itemsize)
14084  * if tmp == NULL: # <<<<<<<<<<<<<<
14085  * raise MemoryError
14086  * item = tmp
14087  */
14088  __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
14089  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
14090  if (unlikely(__pyx_t_2)) {
14091 
14092  /* "View.MemoryView":463
14093  * tmp = PyMem_Malloc(self.view.itemsize)
14094  * if tmp == NULL:
14095  * raise MemoryError # <<<<<<<<<<<<<<
14096  * item = tmp
14097  * else:
14098  */
14099  __Pyx_TraceLine(463,0,__PYX_ERR(1, 463, __pyx_L1_error))
14100  PyErr_NoMemory(); __PYX_ERR(1, 463, __pyx_L1_error)
14101 
14102  /* "View.MemoryView":462
14103  * if <size_t>self.view.itemsize > sizeof(array):
14104  * tmp = PyMem_Malloc(self.view.itemsize)
14105  * if tmp == NULL: # <<<<<<<<<<<<<<
14106  * raise MemoryError
14107  * item = tmp
14108  */
14109  }
14110 
14111  /* "View.MemoryView":464
14112  * if tmp == NULL:
14113  * raise MemoryError
14114  * item = tmp # <<<<<<<<<<<<<<
14115  * else:
14116  * item = <void *> array
14117  */
14118  __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
14119  __pyx_v_item = __pyx_v_tmp;
14120 
14121  /* "View.MemoryView":460
14122  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
14123  *
14124  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
14125  * tmp = PyMem_Malloc(self.view.itemsize)
14126  * if tmp == NULL:
14127  */
14128  goto __pyx_L3;
14129  }
14130 
14131  /* "View.MemoryView":466
14132  * item = tmp
14133  * else:
14134  * item = <void *> array # <<<<<<<<<<<<<<
14135  *
14136  * try:
14137  */
14138  __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
14139  /*else*/ {
14140  __pyx_v_item = ((void *)__pyx_v_array);
14141  }
14142  __pyx_L3:;
14143 
14144  /* "View.MemoryView":468
14145  * item = <void *> array
14146  *
14147  * try: # <<<<<<<<<<<<<<
14148  * if self.dtype_is_object:
14149  * (<PyObject **> item)[0] = <PyObject *> value
14150  */
14151  __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L1_error))
14152  /*try:*/ {
14153 
14154  /* "View.MemoryView":469
14155  *
14156  * try:
14157  * if self.dtype_is_object: # <<<<<<<<<<<<<<
14158  * (<PyObject **> item)[0] = <PyObject *> value
14159  * else:
14160  */
14161  __Pyx_TraceLine(469,0,__PYX_ERR(1, 469, __pyx_L6_error))
14162  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
14163  if (__pyx_t_2) {
14164 
14165  /* "View.MemoryView":470
14166  * try:
14167  * if self.dtype_is_object:
14168  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
14169  * else:
14170  * self.assign_item_from_object(<char *> item, value)
14171  */
14172  __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
14173  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
14174 
14175  /* "View.MemoryView":469
14176  *
14177  * try:
14178  * if self.dtype_is_object: # <<<<<<<<<<<<<<
14179  * (<PyObject **> item)[0] = <PyObject *> value
14180  * else:
14181  */
14182  goto __pyx_L8;
14183  }
14184 
14185  /* "View.MemoryView":472
14186  * (<PyObject **> item)[0] = <PyObject *> value
14187  * else:
14188  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
14189  *
14190  *
14191  */
14192  __Pyx_TraceLine(472,0,__PYX_ERR(1, 472, __pyx_L6_error))
14193  /*else*/ {
14194  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 472, __pyx_L6_error)
14195  __Pyx_GOTREF(__pyx_t_3);
14196  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14197  }
14198  __pyx_L8:;
14199 
14200  /* "View.MemoryView":476
14201  *
14202  *
14203  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
14204  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
14205  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
14206  */
14207  __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
14208  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
14209  if (__pyx_t_2) {
14210 
14211  /* "View.MemoryView":477
14212  *
14213  * if self.view.suboffsets != NULL:
14214  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
14215  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
14216  * item, self.dtype_is_object)
14217  */
14218  __Pyx_TraceLine(477,0,__PYX_ERR(1, 477, __pyx_L6_error))
14219  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 477, __pyx_L6_error)
14220  __Pyx_GOTREF(__pyx_t_3);
14221  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14222 
14223  /* "View.MemoryView":476
14224  *
14225  *
14226  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
14227  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
14228  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
14229  */
14230  }
14231 
14232  /* "View.MemoryView":478
14233  * if self.view.suboffsets != NULL:
14234  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
14235  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
14236  * item, self.dtype_is_object)
14237  * finally:
14238  */
14239  __Pyx_TraceLine(478,0,__PYX_ERR(1, 478, __pyx_L6_error))
14240  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
14241  }
14242 
14243  /* "View.MemoryView":481
14244  * item, self.dtype_is_object)
14245  * finally:
14246  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
14247  *
14248  * cdef setitem_indexed(self, index, value):
14249  */
14250  __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L6_error))
14251  /*finally:*/ {
14252  /*normal exit:*/{
14253  PyMem_Free(__pyx_v_tmp);
14254  goto __pyx_L7;
14255  }
14256  __pyx_L6_error:;
14257  /*exception exit:*/{
14258  __Pyx_PyThreadState_declare
14259  __Pyx_PyThreadState_assign
14260  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
14261  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14262  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
14263  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
14264  __Pyx_XGOTREF(__pyx_t_7);
14265  __Pyx_XGOTREF(__pyx_t_8);
14266  __Pyx_XGOTREF(__pyx_t_9);
14267  __Pyx_XGOTREF(__pyx_t_10);
14268  __Pyx_XGOTREF(__pyx_t_11);
14269  __Pyx_XGOTREF(__pyx_t_12);
14270  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
14271  {
14272  PyMem_Free(__pyx_v_tmp);
14273  }
14274  if (PY_MAJOR_VERSION >= 3) {
14275  __Pyx_XGIVEREF(__pyx_t_10);
14276  __Pyx_XGIVEREF(__pyx_t_11);
14277  __Pyx_XGIVEREF(__pyx_t_12);
14278  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
14279  }
14280  __Pyx_XGIVEREF(__pyx_t_7);
14281  __Pyx_XGIVEREF(__pyx_t_8);
14282  __Pyx_XGIVEREF(__pyx_t_9);
14283  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
14284  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
14285  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
14286  goto __pyx_L1_error;
14287  }
14288  __pyx_L7:;
14289  }
14290 
14291  /* "View.MemoryView":451
14292  * src.ndim, dst.ndim, self.dtype_is_object)
14293  *
14294  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
14295  * cdef int array[128]
14296  * cdef void *tmp = NULL
14297  */
14298 
14299  /* function exit code */
14300  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14301  goto __pyx_L0;
14302  __pyx_L1_error:;
14303  __Pyx_XDECREF(__pyx_t_3);
14304  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
14305  __pyx_r = 0;
14306  __pyx_L0:;
14307  __Pyx_XGIVEREF(__pyx_r);
14308  __Pyx_TraceReturn(__pyx_r, 0);
14309  __Pyx_RefNannyFinishContext();
14310  return __pyx_r;
14311 }
14312 
14313 /* "View.MemoryView":483
14314  * PyMem_Free(tmp)
14315  *
14316  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
14317  * cdef char *itemp = self.get_item_pointer(index)
14318  * self.assign_item_from_object(itemp, value)
14319  */
14320 
14321 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
14322  char *__pyx_v_itemp;
14323  PyObject *__pyx_r = NULL;
14324  __Pyx_TraceDeclarations
14325  __Pyx_RefNannyDeclarations
14326  char *__pyx_t_1;
14327  PyObject *__pyx_t_2 = NULL;
14328  int __pyx_lineno = 0;
14329  const char *__pyx_filename = NULL;
14330  int __pyx_clineno = 0;
14331  __Pyx_RefNannySetupContext("setitem_indexed", 0);
14332  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 483, 0, __PYX_ERR(1, 483, __pyx_L1_error));
14333 
14334  /* "View.MemoryView":484
14335  *
14336  * cdef setitem_indexed(self, index, value):
14337  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
14338  * self.assign_item_from_object(itemp, value)
14339  *
14340  */
14341  __Pyx_TraceLine(484,0,__PYX_ERR(1, 484, __pyx_L1_error))
14342  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 484, __pyx_L1_error)
14343  __pyx_v_itemp = __pyx_t_1;
14344 
14345  /* "View.MemoryView":485
14346  * cdef setitem_indexed(self, index, value):
14347  * cdef char *itemp = self.get_item_pointer(index)
14348  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
14349  *
14350  * cdef convert_item_to_object(self, char *itemp):
14351  */
14352  __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
14353  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 485, __pyx_L1_error)
14354  __Pyx_GOTREF(__pyx_t_2);
14355  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14356 
14357  /* "View.MemoryView":483
14358  * PyMem_Free(tmp)
14359  *
14360  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
14361  * cdef char *itemp = self.get_item_pointer(index)
14362  * self.assign_item_from_object(itemp, value)
14363  */
14364 
14365  /* function exit code */
14366  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14367  goto __pyx_L0;
14368  __pyx_L1_error:;
14369  __Pyx_XDECREF(__pyx_t_2);
14370  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
14371  __pyx_r = 0;
14372  __pyx_L0:;
14373  __Pyx_XGIVEREF(__pyx_r);
14374  __Pyx_TraceReturn(__pyx_r, 0);
14375  __Pyx_RefNannyFinishContext();
14376  return __pyx_r;
14377 }
14378 
14379 /* "View.MemoryView":487
14380  * self.assign_item_from_object(itemp, value)
14381  *
14382  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14383  * """Only used if instantiated manually by the user, or if Cython doesn't
14384  * know how to convert the type"""
14385  */
14386 
14387 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
14388  PyObject *__pyx_v_struct = NULL;
14389  PyObject *__pyx_v_bytesitem = 0;
14390  PyObject *__pyx_v_result = NULL;
14391  PyObject *__pyx_r = NULL;
14392  __Pyx_TraceDeclarations
14393  __Pyx_RefNannyDeclarations
14394  PyObject *__pyx_t_1 = NULL;
14395  PyObject *__pyx_t_2 = NULL;
14396  PyObject *__pyx_t_3 = NULL;
14397  PyObject *__pyx_t_4 = NULL;
14398  PyObject *__pyx_t_5 = NULL;
14399  PyObject *__pyx_t_6 = NULL;
14400  PyObject *__pyx_t_7 = NULL;
14401  int __pyx_t_8;
14402  PyObject *__pyx_t_9 = NULL;
14403  size_t __pyx_t_10;
14404  int __pyx_t_11;
14405  int __pyx_lineno = 0;
14406  const char *__pyx_filename = NULL;
14407  int __pyx_clineno = 0;
14408  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
14409  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 487, 0, __PYX_ERR(1, 487, __pyx_L1_error));
14410 
14411  /* "View.MemoryView":490
14412  * """Only used if instantiated manually by the user, or if Cython doesn't
14413  * know how to convert the type"""
14414  * import struct # <<<<<<<<<<<<<<
14415  * cdef bytes bytesitem
14416  *
14417  */
14418  __Pyx_TraceLine(490,0,__PYX_ERR(1, 490, __pyx_L1_error))
14419  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 490, __pyx_L1_error)
14420  __Pyx_GOTREF(__pyx_t_1);
14421  __pyx_v_struct = __pyx_t_1;
14422  __pyx_t_1 = 0;
14423 
14424  /* "View.MemoryView":493
14425  * cdef bytes bytesitem
14426  *
14427  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
14428  * try:
14429  * result = struct.unpack(self.view.format, bytesitem)
14430  */
14431  __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L1_error))
14432  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
14433  __Pyx_GOTREF(__pyx_t_1);
14434  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
14435  __pyx_t_1 = 0;
14436 
14437  /* "View.MemoryView":494
14438  *
14439  * bytesitem = itemp[:self.view.itemsize]
14440  * try: # <<<<<<<<<<<<<<
14441  * result = struct.unpack(self.view.format, bytesitem)
14442  * except struct.error:
14443  */
14444  __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L1_error))
14445  {
14446  __Pyx_PyThreadState_declare
14447  __Pyx_PyThreadState_assign
14448  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
14449  __Pyx_XGOTREF(__pyx_t_2);
14450  __Pyx_XGOTREF(__pyx_t_3);
14451  __Pyx_XGOTREF(__pyx_t_4);
14452  /*try:*/ {
14453 
14454  /* "View.MemoryView":495
14455  * bytesitem = itemp[:self.view.itemsize]
14456  * try:
14457  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
14458  * except struct.error:
14459  * raise ValueError("Unable to convert item to object")
14460  */
14461  __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L3_error))
14462  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 495, __pyx_L3_error)
14463  __Pyx_GOTREF(__pyx_t_5);
14464  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L3_error)
14465  __Pyx_GOTREF(__pyx_t_6);
14466  __pyx_t_7 = NULL;
14467  __pyx_t_8 = 0;
14468  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
14469  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
14470  if (likely(__pyx_t_7)) {
14471  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
14472  __Pyx_INCREF(__pyx_t_7);
14473  __Pyx_INCREF(function);
14474  __Pyx_DECREF_SET(__pyx_t_5, function);
14475  __pyx_t_8 = 1;
14476  }
14477  }
14478  #if CYTHON_FAST_PYCALL
14479  if (PyFunction_Check(__pyx_t_5)) {
14480  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
14481  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
14482  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14483  __Pyx_GOTREF(__pyx_t_1);
14484  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14485  } else
14486  #endif
14487  #if CYTHON_FAST_PYCCALL
14488  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
14489  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
14490  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
14491  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14492  __Pyx_GOTREF(__pyx_t_1);
14493  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14494  } else
14495  #endif
14496  {
14497  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 495, __pyx_L3_error)
14498  __Pyx_GOTREF(__pyx_t_9);
14499  if (__pyx_t_7) {
14500  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
14501  }
14502  __Pyx_GIVEREF(__pyx_t_6);
14503  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
14504  __Pyx_INCREF(__pyx_v_bytesitem);
14505  __Pyx_GIVEREF(__pyx_v_bytesitem);
14506  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
14507  __pyx_t_6 = 0;
14508  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L3_error)
14509  __Pyx_GOTREF(__pyx_t_1);
14510  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14511  }
14512  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14513  __pyx_v_result = __pyx_t_1;
14514  __pyx_t_1 = 0;
14515 
14516  /* "View.MemoryView":494
14517  *
14518  * bytesitem = itemp[:self.view.itemsize]
14519  * try: # <<<<<<<<<<<<<<
14520  * result = struct.unpack(self.view.format, bytesitem)
14521  * except struct.error:
14522  */
14523  }
14524 
14525  /* "View.MemoryView":499
14526  * raise ValueError("Unable to convert item to object")
14527  * else:
14528  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
14529  * return result[0]
14530  * return result
14531  */
14532  __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
14533  /*else:*/ {
14534  __pyx_t_10 = strlen(__pyx_v_self->view.format);
14535  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
14536  if (__pyx_t_11) {
14537 
14538  /* "View.MemoryView":500
14539  * else:
14540  * if len(self.view.format) == 1:
14541  * return result[0] # <<<<<<<<<<<<<<
14542  * return result
14543  *
14544  */
14545  __Pyx_TraceLine(500,0,__PYX_ERR(1, 500, __pyx_L5_except_error))
14546  __Pyx_XDECREF(__pyx_r);
14547  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L5_except_error)
14548  __Pyx_GOTREF(__pyx_t_1);
14549  __pyx_r = __pyx_t_1;
14550  __pyx_t_1 = 0;
14551  goto __pyx_L6_except_return;
14552 
14553  /* "View.MemoryView":499
14554  * raise ValueError("Unable to convert item to object")
14555  * else:
14556  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
14557  * return result[0]
14558  * return result
14559  */
14560  }
14561 
14562  /* "View.MemoryView":501
14563  * if len(self.view.format) == 1:
14564  * return result[0]
14565  * return result # <<<<<<<<<<<<<<
14566  *
14567  * cdef assign_item_from_object(self, char *itemp, object value):
14568  */
14569  __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L5_except_error))
14570  __Pyx_XDECREF(__pyx_r);
14571  __Pyx_INCREF(__pyx_v_result);
14572  __pyx_r = __pyx_v_result;
14573  goto __pyx_L6_except_return;
14574  }
14575  __pyx_L3_error:;
14576  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14577  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14578  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14579  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14580  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14581 
14582  /* "View.MemoryView":496
14583  * try:
14584  * result = struct.unpack(self.view.format, bytesitem)
14585  * except struct.error: # <<<<<<<<<<<<<<
14586  * raise ValueError("Unable to convert item to object")
14587  * else:
14588  */
14589  __Pyx_TraceLine(496,0,__PYX_ERR(1, 496, __pyx_L5_except_error))
14590  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
14591  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 496, __pyx_L5_except_error)
14592  __Pyx_GOTREF(__pyx_t_6);
14593  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
14594  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14595  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
14596  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
14597  if (__pyx_t_8) {
14598  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14599  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L5_except_error)
14600  __Pyx_GOTREF(__pyx_t_9);
14601  __Pyx_GOTREF(__pyx_t_5);
14602  __Pyx_GOTREF(__pyx_t_1);
14603 
14604  /* "View.MemoryView":497
14605  * result = struct.unpack(self.view.format, bytesitem)
14606  * except struct.error:
14607  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
14608  * else:
14609  * if len(self.view.format) == 1:
14610  */
14611  __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
14612  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L5_except_error)
14613  __Pyx_GOTREF(__pyx_t_6);
14614  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
14615  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14616  __PYX_ERR(1, 497, __pyx_L5_except_error)
14617  }
14618  goto __pyx_L5_except_error;
14619  __pyx_L5_except_error:;
14620 
14621  /* "View.MemoryView":494
14622  *
14623  * bytesitem = itemp[:self.view.itemsize]
14624  * try: # <<<<<<<<<<<<<<
14625  * result = struct.unpack(self.view.format, bytesitem)
14626  * except struct.error:
14627  */
14628  __Pyx_XGIVEREF(__pyx_t_2);
14629  __Pyx_XGIVEREF(__pyx_t_3);
14630  __Pyx_XGIVEREF(__pyx_t_4);
14631  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
14632  goto __pyx_L1_error;
14633  __pyx_L6_except_return:;
14634  __Pyx_XGIVEREF(__pyx_t_2);
14635  __Pyx_XGIVEREF(__pyx_t_3);
14636  __Pyx_XGIVEREF(__pyx_t_4);
14637  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
14638  goto __pyx_L0;
14639  }
14640 
14641  /* "View.MemoryView":487
14642  * self.assign_item_from_object(itemp, value)
14643  *
14644  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14645  * """Only used if instantiated manually by the user, or if Cython doesn't
14646  * know how to convert the type"""
14647  */
14648 
14649  /* function exit code */
14650  __pyx_L1_error:;
14651  __Pyx_XDECREF(__pyx_t_1);
14652  __Pyx_XDECREF(__pyx_t_5);
14653  __Pyx_XDECREF(__pyx_t_6);
14654  __Pyx_XDECREF(__pyx_t_7);
14655  __Pyx_XDECREF(__pyx_t_9);
14656  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14657  __pyx_r = 0;
14658  __pyx_L0:;
14659  __Pyx_XDECREF(__pyx_v_struct);
14660  __Pyx_XDECREF(__pyx_v_bytesitem);
14661  __Pyx_XDECREF(__pyx_v_result);
14662  __Pyx_XGIVEREF(__pyx_r);
14663  __Pyx_TraceReturn(__pyx_r, 0);
14664  __Pyx_RefNannyFinishContext();
14665  return __pyx_r;
14666 }
14667 
14668 /* "View.MemoryView":503
14669  * return result
14670  *
14671  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14672  * """Only used if instantiated manually by the user, or if Cython doesn't
14673  * know how to convert the type"""
14674  */
14675 
14676 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14677  PyObject *__pyx_v_struct = NULL;
14678  char __pyx_v_c;
14679  PyObject *__pyx_v_bytesvalue = 0;
14680  Py_ssize_t __pyx_v_i;
14681  PyObject *__pyx_r = NULL;
14682  __Pyx_TraceDeclarations
14683  __Pyx_RefNannyDeclarations
14684  PyObject *__pyx_t_1 = NULL;
14685  int __pyx_t_2;
14686  int __pyx_t_3;
14687  PyObject *__pyx_t_4 = NULL;
14688  PyObject *__pyx_t_5 = NULL;
14689  PyObject *__pyx_t_6 = NULL;
14690  int __pyx_t_7;
14691  PyObject *__pyx_t_8 = NULL;
14692  Py_ssize_t __pyx_t_9;
14693  PyObject *__pyx_t_10 = NULL;
14694  char *__pyx_t_11;
14695  char *__pyx_t_12;
14696  char *__pyx_t_13;
14697  char *__pyx_t_14;
14698  int __pyx_lineno = 0;
14699  const char *__pyx_filename = NULL;
14700  int __pyx_clineno = 0;
14701  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
14702  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 503, 0, __PYX_ERR(1, 503, __pyx_L1_error));
14703 
14704  /* "View.MemoryView":506
14705  * """Only used if instantiated manually by the user, or if Cython doesn't
14706  * know how to convert the type"""
14707  * import struct # <<<<<<<<<<<<<<
14708  * cdef char c
14709  * cdef bytes bytesvalue
14710  */
14711  __Pyx_TraceLine(506,0,__PYX_ERR(1, 506, __pyx_L1_error))
14712  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 506, __pyx_L1_error)
14713  __Pyx_GOTREF(__pyx_t_1);
14714  __pyx_v_struct = __pyx_t_1;
14715  __pyx_t_1 = 0;
14716 
14717  /* "View.MemoryView":511
14718  * cdef Py_ssize_t i
14719  *
14720  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
14721  * bytesvalue = struct.pack(self.view.format, *value)
14722  * else:
14723  */
14724  __Pyx_TraceLine(511,0,__PYX_ERR(1, 511, __pyx_L1_error))
14725  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
14726  __pyx_t_3 = (__pyx_t_2 != 0);
14727  if (__pyx_t_3) {
14728 
14729  /* "View.MemoryView":512
14730  *
14731  * if isinstance(value, tuple):
14732  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
14733  * else:
14734  * bytesvalue = struct.pack(self.view.format, value)
14735  */
14736  __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
14737  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
14738  __Pyx_GOTREF(__pyx_t_1);
14739  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
14740  __Pyx_GOTREF(__pyx_t_4);
14741  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 512, __pyx_L1_error)
14742  __Pyx_GOTREF(__pyx_t_5);
14743  __Pyx_GIVEREF(__pyx_t_4);
14744  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
14745  __pyx_t_4 = 0;
14746  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
14747  __Pyx_GOTREF(__pyx_t_4);
14748  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
14749  __Pyx_GOTREF(__pyx_t_6);
14750  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14751  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14752  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
14753  __Pyx_GOTREF(__pyx_t_4);
14754  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14755  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14756  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
14757  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
14758  __pyx_t_4 = 0;
14759 
14760  /* "View.MemoryView":511
14761  * cdef Py_ssize_t i
14762  *
14763  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
14764  * bytesvalue = struct.pack(self.view.format, *value)
14765  * else:
14766  */
14767  goto __pyx_L3;
14768  }
14769 
14770  /* "View.MemoryView":514
14771  * bytesvalue = struct.pack(self.view.format, *value)
14772  * else:
14773  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
14774  *
14775  * for i, c in enumerate(bytesvalue):
14776  */
14777  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
14778  /*else*/ {
14779  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 514, __pyx_L1_error)
14780  __Pyx_GOTREF(__pyx_t_6);
14781  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
14782  __Pyx_GOTREF(__pyx_t_1);
14783  __pyx_t_5 = NULL;
14784  __pyx_t_7 = 0;
14785  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
14786  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
14787  if (likely(__pyx_t_5)) {
14788  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
14789  __Pyx_INCREF(__pyx_t_5);
14790  __Pyx_INCREF(function);
14791  __Pyx_DECREF_SET(__pyx_t_6, function);
14792  __pyx_t_7 = 1;
14793  }
14794  }
14795  #if CYTHON_FAST_PYCALL
14796  if (PyFunction_Check(__pyx_t_6)) {
14797  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
14798  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
14799  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14800  __Pyx_GOTREF(__pyx_t_4);
14801  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14802  } else
14803  #endif
14804  #if CYTHON_FAST_PYCCALL
14805  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
14806  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
14807  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
14808  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14809  __Pyx_GOTREF(__pyx_t_4);
14810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14811  } else
14812  #endif
14813  {
14814  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 514, __pyx_L1_error)
14815  __Pyx_GOTREF(__pyx_t_8);
14816  if (__pyx_t_5) {
14817  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
14818  }
14819  __Pyx_GIVEREF(__pyx_t_1);
14820  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
14821  __Pyx_INCREF(__pyx_v_value);
14822  __Pyx_GIVEREF(__pyx_v_value);
14823  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
14824  __pyx_t_1 = 0;
14825  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
14826  __Pyx_GOTREF(__pyx_t_4);
14827  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
14828  }
14829  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14830  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 514, __pyx_L1_error)
14831  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
14832  __pyx_t_4 = 0;
14833  }
14834  __pyx_L3:;
14835 
14836  /* "View.MemoryView":516
14837  * bytesvalue = struct.pack(self.view.format, value)
14838  *
14839  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
14840  * itemp[i] = c
14841  *
14842  */
14843  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
14844  __pyx_t_9 = 0;
14845  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
14846  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
14847  __PYX_ERR(1, 516, __pyx_L1_error)
14848  }
14849  __Pyx_INCREF(__pyx_v_bytesvalue);
14850  __pyx_t_10 = __pyx_v_bytesvalue;
14851  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
14852  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
14853  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
14854  __pyx_t_11 = __pyx_t_14;
14855  __pyx_v_c = (__pyx_t_11[0]);
14856 
14857  /* "View.MemoryView":517
14858  *
14859  * for i, c in enumerate(bytesvalue):
14860  * itemp[i] = c # <<<<<<<<<<<<<<
14861  *
14862  * @cname('getbuffer')
14863  */
14864  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
14865  __pyx_v_i = __pyx_t_9;
14866 
14867  /* "View.MemoryView":516
14868  * bytesvalue = struct.pack(self.view.format, value)
14869  *
14870  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
14871  * itemp[i] = c
14872  *
14873  */
14874  __Pyx_TraceLine(516,0,__PYX_ERR(1, 516, __pyx_L1_error))
14875  __pyx_t_9 = (__pyx_t_9 + 1);
14876 
14877  /* "View.MemoryView":517
14878  *
14879  * for i, c in enumerate(bytesvalue):
14880  * itemp[i] = c # <<<<<<<<<<<<<<
14881  *
14882  * @cname('getbuffer')
14883  */
14884  __Pyx_TraceLine(517,0,__PYX_ERR(1, 517, __pyx_L1_error))
14885  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
14886  }
14887  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
14888 
14889  /* "View.MemoryView":503
14890  * return result
14891  *
14892  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14893  * """Only used if instantiated manually by the user, or if Cython doesn't
14894  * know how to convert the type"""
14895  */
14896 
14897  /* function exit code */
14898  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14899  goto __pyx_L0;
14900  __pyx_L1_error:;
14901  __Pyx_XDECREF(__pyx_t_1);
14902  __Pyx_XDECREF(__pyx_t_4);
14903  __Pyx_XDECREF(__pyx_t_5);
14904  __Pyx_XDECREF(__pyx_t_6);
14905  __Pyx_XDECREF(__pyx_t_8);
14906  __Pyx_XDECREF(__pyx_t_10);
14907  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14908  __pyx_r = 0;
14909  __pyx_L0:;
14910  __Pyx_XDECREF(__pyx_v_struct);
14911  __Pyx_XDECREF(__pyx_v_bytesvalue);
14912  __Pyx_XGIVEREF(__pyx_r);
14913  __Pyx_TraceReturn(__pyx_r, 0);
14914  __Pyx_RefNannyFinishContext();
14915  return __pyx_r;
14916 }
14917 
14918 /* "View.MemoryView":520
14919  *
14920  * @cname('getbuffer')
14921  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
14922  * if flags & PyBUF_WRITABLE and self.view.readonly:
14923  * raise ValueError("Cannot create writable memory view from read-only memoryview")
14924  */
14925 
14926 /* Python wrapper */
14927 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
14928 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
14929  int __pyx_r;
14930  __Pyx_RefNannyDeclarations
14931  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
14932  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
14933 
14934  /* function exit code */
14935  __Pyx_RefNannyFinishContext();
14936  return __pyx_r;
14937 }
14938 
14939 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
14940  int __pyx_r;
14941  __Pyx_TraceDeclarations
14942  __Pyx_RefNannyDeclarations
14943  int __pyx_t_1;
14944  int __pyx_t_2;
14945  PyObject *__pyx_t_3 = NULL;
14946  Py_ssize_t *__pyx_t_4;
14947  char *__pyx_t_5;
14948  void *__pyx_t_6;
14949  int __pyx_t_7;
14950  Py_ssize_t __pyx_t_8;
14951  int __pyx_lineno = 0;
14952  const char *__pyx_filename = NULL;
14953  int __pyx_clineno = 0;
14954  if (__pyx_v_info == NULL) {
14955  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
14956  return -1;
14957  }
14958  __Pyx_RefNannySetupContext("__getbuffer__", 0);
14959  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
14960  __Pyx_GIVEREF(__pyx_v_info->obj);
14961  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 520, 0, __PYX_ERR(1, 520, __pyx_L1_error));
14962 
14963  /* "View.MemoryView":521
14964  * @cname('getbuffer')
14965  * def __getbuffer__(self, Py_buffer *info, int flags):
14966  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
14967  * raise ValueError("Cannot create writable memory view from read-only memoryview")
14968  *
14969  */
14970  __Pyx_TraceLine(521,0,__PYX_ERR(1, 521, __pyx_L1_error))
14971  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
14972  if (__pyx_t_2) {
14973  } else {
14974  __pyx_t_1 = __pyx_t_2;
14975  goto __pyx_L4_bool_binop_done;
14976  }
14977  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
14978  __pyx_t_1 = __pyx_t_2;
14979  __pyx_L4_bool_binop_done:;
14980  if (unlikely(__pyx_t_1)) {
14981 
14982  /* "View.MemoryView":522
14983  * def __getbuffer__(self, Py_buffer *info, int flags):
14984  * if flags & PyBUF_WRITABLE and self.view.readonly:
14985  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
14986  *
14987  * if flags & PyBUF_ND:
14988  */
14989  __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
14990  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 522, __pyx_L1_error)
14991  __Pyx_GOTREF(__pyx_t_3);
14992  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14993  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14994  __PYX_ERR(1, 522, __pyx_L1_error)
14995 
14996  /* "View.MemoryView":521
14997  * @cname('getbuffer')
14998  * def __getbuffer__(self, Py_buffer *info, int flags):
14999  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
15000  * raise ValueError("Cannot create writable memory view from read-only memoryview")
15001  *
15002  */
15003  }
15004 
15005  /* "View.MemoryView":524
15006  * raise ValueError("Cannot create writable memory view from read-only memoryview")
15007  *
15008  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
15009  * info.shape = self.view.shape
15010  * else:
15011  */
15012  __Pyx_TraceLine(524,0,__PYX_ERR(1, 524, __pyx_L1_error))
15013  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
15014  if (__pyx_t_1) {
15015 
15016  /* "View.MemoryView":525
15017  *
15018  * if flags & PyBUF_ND:
15019  * info.shape = self.view.shape # <<<<<<<<<<<<<<
15020  * else:
15021  * info.shape = NULL
15022  */
15023  __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
15024  __pyx_t_4 = __pyx_v_self->view.shape;
15025  __pyx_v_info->shape = __pyx_t_4;
15026 
15027  /* "View.MemoryView":524
15028  * raise ValueError("Cannot create writable memory view from read-only memoryview")
15029  *
15030  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
15031  * info.shape = self.view.shape
15032  * else:
15033  */
15034  goto __pyx_L6;
15035  }
15036 
15037  /* "View.MemoryView":527
15038  * info.shape = self.view.shape
15039  * else:
15040  * info.shape = NULL # <<<<<<<<<<<<<<
15041  *
15042  * if flags & PyBUF_STRIDES:
15043  */
15044  __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
15045  /*else*/ {
15046  __pyx_v_info->shape = NULL;
15047  }
15048  __pyx_L6:;
15049 
15050  /* "View.MemoryView":529
15051  * info.shape = NULL
15052  *
15053  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
15054  * info.strides = self.view.strides
15055  * else:
15056  */
15057  __Pyx_TraceLine(529,0,__PYX_ERR(1, 529, __pyx_L1_error))
15058  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
15059  if (__pyx_t_1) {
15060 
15061  /* "View.MemoryView":530
15062  *
15063  * if flags & PyBUF_STRIDES:
15064  * info.strides = self.view.strides # <<<<<<<<<<<<<<
15065  * else:
15066  * info.strides = NULL
15067  */
15068  __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
15069  __pyx_t_4 = __pyx_v_self->view.strides;
15070  __pyx_v_info->strides = __pyx_t_4;
15071 
15072  /* "View.MemoryView":529
15073  * info.shape = NULL
15074  *
15075  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
15076  * info.strides = self.view.strides
15077  * else:
15078  */
15079  goto __pyx_L7;
15080  }
15081 
15082  /* "View.MemoryView":532
15083  * info.strides = self.view.strides
15084  * else:
15085  * info.strides = NULL # <<<<<<<<<<<<<<
15086  *
15087  * if flags & PyBUF_INDIRECT:
15088  */
15089  __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
15090  /*else*/ {
15091  __pyx_v_info->strides = NULL;
15092  }
15093  __pyx_L7:;
15094 
15095  /* "View.MemoryView":534
15096  * info.strides = NULL
15097  *
15098  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
15099  * info.suboffsets = self.view.suboffsets
15100  * else:
15101  */
15102  __Pyx_TraceLine(534,0,__PYX_ERR(1, 534, __pyx_L1_error))
15103  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
15104  if (__pyx_t_1) {
15105 
15106  /* "View.MemoryView":535
15107  *
15108  * if flags & PyBUF_INDIRECT:
15109  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
15110  * else:
15111  * info.suboffsets = NULL
15112  */
15113  __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
15114  __pyx_t_4 = __pyx_v_self->view.suboffsets;
15115  __pyx_v_info->suboffsets = __pyx_t_4;
15116 
15117  /* "View.MemoryView":534
15118  * info.strides = NULL
15119  *
15120  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
15121  * info.suboffsets = self.view.suboffsets
15122  * else:
15123  */
15124  goto __pyx_L8;
15125  }
15126 
15127  /* "View.MemoryView":537
15128  * info.suboffsets = self.view.suboffsets
15129  * else:
15130  * info.suboffsets = NULL # <<<<<<<<<<<<<<
15131  *
15132  * if flags & PyBUF_FORMAT:
15133  */
15134  __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
15135  /*else*/ {
15136  __pyx_v_info->suboffsets = NULL;
15137  }
15138  __pyx_L8:;
15139 
15140  /* "View.MemoryView":539
15141  * info.suboffsets = NULL
15142  *
15143  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
15144  * info.format = self.view.format
15145  * else:
15146  */
15147  __Pyx_TraceLine(539,0,__PYX_ERR(1, 539, __pyx_L1_error))
15148  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
15149  if (__pyx_t_1) {
15150 
15151  /* "View.MemoryView":540
15152  *
15153  * if flags & PyBUF_FORMAT:
15154  * info.format = self.view.format # <<<<<<<<<<<<<<
15155  * else:
15156  * info.format = NULL
15157  */
15158  __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
15159  __pyx_t_5 = __pyx_v_self->view.format;
15160  __pyx_v_info->format = __pyx_t_5;
15161 
15162  /* "View.MemoryView":539
15163  * info.suboffsets = NULL
15164  *
15165  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
15166  * info.format = self.view.format
15167  * else:
15168  */
15169  goto __pyx_L9;
15170  }
15171 
15172  /* "View.MemoryView":542
15173  * info.format = self.view.format
15174  * else:
15175  * info.format = NULL # <<<<<<<<<<<<<<
15176  *
15177  * info.buf = self.view.buf
15178  */
15179  __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
15180  /*else*/ {
15181  __pyx_v_info->format = NULL;
15182  }
15183  __pyx_L9:;
15184 
15185  /* "View.MemoryView":544
15186  * info.format = NULL
15187  *
15188  * info.buf = self.view.buf # <<<<<<<<<<<<<<
15189  * info.ndim = self.view.ndim
15190  * info.itemsize = self.view.itemsize
15191  */
15192  __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
15193  __pyx_t_6 = __pyx_v_self->view.buf;
15194  __pyx_v_info->buf = __pyx_t_6;
15195 
15196  /* "View.MemoryView":545
15197  *
15198  * info.buf = self.view.buf
15199  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
15200  * info.itemsize = self.view.itemsize
15201  * info.len = self.view.len
15202  */
15203  __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
15204  __pyx_t_7 = __pyx_v_self->view.ndim;
15205  __pyx_v_info->ndim = __pyx_t_7;
15206 
15207  /* "View.MemoryView":546
15208  * info.buf = self.view.buf
15209  * info.ndim = self.view.ndim
15210  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
15211  * info.len = self.view.len
15212  * info.readonly = self.view.readonly
15213  */
15214  __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
15215  __pyx_t_8 = __pyx_v_self->view.itemsize;
15216  __pyx_v_info->itemsize = __pyx_t_8;
15217 
15218  /* "View.MemoryView":547
15219  * info.ndim = self.view.ndim
15220  * info.itemsize = self.view.itemsize
15221  * info.len = self.view.len # <<<<<<<<<<<<<<
15222  * info.readonly = self.view.readonly
15223  * info.obj = self
15224  */
15225  __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
15226  __pyx_t_8 = __pyx_v_self->view.len;
15227  __pyx_v_info->len = __pyx_t_8;
15228 
15229  /* "View.MemoryView":548
15230  * info.itemsize = self.view.itemsize
15231  * info.len = self.view.len
15232  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
15233  * info.obj = self
15234  *
15235  */
15236  __Pyx_TraceLine(548,0,__PYX_ERR(1, 548, __pyx_L1_error))
15237  __pyx_t_1 = __pyx_v_self->view.readonly;
15238  __pyx_v_info->readonly = __pyx_t_1;
15239 
15240  /* "View.MemoryView":549
15241  * info.len = self.view.len
15242  * info.readonly = self.view.readonly
15243  * info.obj = self # <<<<<<<<<<<<<<
15244  *
15245  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
15246  */
15247  __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
15248  __Pyx_INCREF(((PyObject *)__pyx_v_self));
15249  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
15250  __Pyx_GOTREF(__pyx_v_info->obj);
15251  __Pyx_DECREF(__pyx_v_info->obj);
15252  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
15253 
15254  /* "View.MemoryView":520
15255  *
15256  * @cname('getbuffer')
15257  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
15258  * if flags & PyBUF_WRITABLE and self.view.readonly:
15259  * raise ValueError("Cannot create writable memory view from read-only memoryview")
15260  */
15261 
15262  /* function exit code */
15263  __pyx_r = 0;
15264  goto __pyx_L0;
15265  __pyx_L1_error:;
15266  __Pyx_XDECREF(__pyx_t_3);
15267  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15268  __pyx_r = -1;
15269  if (__pyx_v_info->obj != NULL) {
15270  __Pyx_GOTREF(__pyx_v_info->obj);
15271  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
15272  }
15273  goto __pyx_L2;
15274  __pyx_L0:;
15275  if (__pyx_v_info->obj == Py_None) {
15276  __Pyx_GOTREF(__pyx_v_info->obj);
15277  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
15278  }
15279  __pyx_L2:;
15280  __Pyx_TraceReturn(Py_None, 0);
15281  __Pyx_RefNannyFinishContext();
15282  return __pyx_r;
15283 }
15284 
15285 /* "View.MemoryView":555
15286  *
15287  * @property
15288  * def T(self): # <<<<<<<<<<<<<<
15289  * cdef _memoryviewslice result = memoryview_copy(self)
15290  * transpose_memslice(&result.from_slice)
15291  */
15292 
15293 /* Python wrapper */
15294 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
15295 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
15296  PyObject *__pyx_r = 0;
15297  __Pyx_RefNannyDeclarations
15298  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15299  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15300 
15301  /* function exit code */
15302  __Pyx_RefNannyFinishContext();
15303  return __pyx_r;
15304 }
15305 
15306 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15307  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15308  PyObject *__pyx_r = NULL;
15309  __Pyx_TraceDeclarations
15310  __Pyx_RefNannyDeclarations
15311  PyObject *__pyx_t_1 = NULL;
15312  int __pyx_t_2;
15313  int __pyx_lineno = 0;
15314  const char *__pyx_filename = NULL;
15315  int __pyx_clineno = 0;
15316  __Pyx_RefNannySetupContext("__get__", 0);
15317  __Pyx_TraceCall("__get__", __pyx_f[1], 555, 0, __PYX_ERR(1, 555, __pyx_L1_error));
15318 
15319  /* "View.MemoryView":556
15320  * @property
15321  * def T(self):
15322  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
15323  * transpose_memslice(&result.from_slice)
15324  * return result
15325  */
15326  __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
15327  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
15328  __Pyx_GOTREF(__pyx_t_1);
15329  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
15330  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
15331  __pyx_t_1 = 0;
15332 
15333  /* "View.MemoryView":557
15334  * def T(self):
15335  * cdef _memoryviewslice result = memoryview_copy(self)
15336  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
15337  * return result
15338  *
15339  */
15340  __Pyx_TraceLine(557,0,__PYX_ERR(1, 557, __pyx_L1_error))
15341  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 557, __pyx_L1_error)
15342 
15343  /* "View.MemoryView":558
15344  * cdef _memoryviewslice result = memoryview_copy(self)
15345  * transpose_memslice(&result.from_slice)
15346  * return result # <<<<<<<<<<<<<<
15347  *
15348  * @property
15349  */
15350  __Pyx_TraceLine(558,0,__PYX_ERR(1, 558, __pyx_L1_error))
15351  __Pyx_XDECREF(__pyx_r);
15352  __Pyx_INCREF(((PyObject *)__pyx_v_result));
15353  __pyx_r = ((PyObject *)__pyx_v_result);
15354  goto __pyx_L0;
15355 
15356  /* "View.MemoryView":555
15357  *
15358  * @property
15359  * def T(self): # <<<<<<<<<<<<<<
15360  * cdef _memoryviewslice result = memoryview_copy(self)
15361  * transpose_memslice(&result.from_slice)
15362  */
15363 
15364  /* function exit code */
15365  __pyx_L1_error:;
15366  __Pyx_XDECREF(__pyx_t_1);
15367  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15368  __pyx_r = NULL;
15369  __pyx_L0:;
15370  __Pyx_XDECREF((PyObject *)__pyx_v_result);
15371  __Pyx_XGIVEREF(__pyx_r);
15372  __Pyx_TraceReturn(__pyx_r, 0);
15373  __Pyx_RefNannyFinishContext();
15374  return __pyx_r;
15375 }
15376 
15377 /* "View.MemoryView":561
15378  *
15379  * @property
15380  * def base(self): # <<<<<<<<<<<<<<
15381  * return self.obj
15382  *
15383  */
15384 
15385 /* Python wrapper */
15386 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
15387 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
15388  PyObject *__pyx_r = 0;
15389  __Pyx_RefNannyDeclarations
15390  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15391  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15392 
15393  /* function exit code */
15394  __Pyx_RefNannyFinishContext();
15395  return __pyx_r;
15396 }
15397 
15398 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15399  PyObject *__pyx_r = NULL;
15400  __Pyx_TraceDeclarations
15401  __Pyx_RefNannyDeclarations
15402  int __pyx_lineno = 0;
15403  const char *__pyx_filename = NULL;
15404  int __pyx_clineno = 0;
15405  __Pyx_RefNannySetupContext("__get__", 0);
15406  __Pyx_TraceCall("__get__", __pyx_f[1], 561, 0, __PYX_ERR(1, 561, __pyx_L1_error));
15407 
15408  /* "View.MemoryView":562
15409  * @property
15410  * def base(self):
15411  * return self.obj # <<<<<<<<<<<<<<
15412  *
15413  * @property
15414  */
15415  __Pyx_TraceLine(562,0,__PYX_ERR(1, 562, __pyx_L1_error))
15416  __Pyx_XDECREF(__pyx_r);
15417  __Pyx_INCREF(__pyx_v_self->obj);
15418  __pyx_r = __pyx_v_self->obj;
15419  goto __pyx_L0;
15420 
15421  /* "View.MemoryView":561
15422  *
15423  * @property
15424  * def base(self): # <<<<<<<<<<<<<<
15425  * return self.obj
15426  *
15427  */
15428 
15429  /* function exit code */
15430  __pyx_L1_error:;
15431  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15432  __pyx_r = NULL;
15433  __pyx_L0:;
15434  __Pyx_XGIVEREF(__pyx_r);
15435  __Pyx_TraceReturn(__pyx_r, 0);
15436  __Pyx_RefNannyFinishContext();
15437  return __pyx_r;
15438 }
15439 
15440 /* "View.MemoryView":565
15441  *
15442  * @property
15443  * def shape(self): # <<<<<<<<<<<<<<
15444  * return tuple([length for length in self.view.shape[:self.view.ndim]])
15445  *
15446  */
15447 
15448 /* Python wrapper */
15449 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
15450 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
15451  PyObject *__pyx_r = 0;
15452  __Pyx_RefNannyDeclarations
15453  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15454  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15455 
15456  /* function exit code */
15457  __Pyx_RefNannyFinishContext();
15458  return __pyx_r;
15459 }
15460 
15461 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15462  Py_ssize_t __pyx_v_length;
15463  PyObject *__pyx_r = NULL;
15464  __Pyx_TraceDeclarations
15465  __Pyx_RefNannyDeclarations
15466  PyObject *__pyx_t_1 = NULL;
15467  Py_ssize_t *__pyx_t_2;
15468  Py_ssize_t *__pyx_t_3;
15469  Py_ssize_t *__pyx_t_4;
15470  PyObject *__pyx_t_5 = NULL;
15471  int __pyx_lineno = 0;
15472  const char *__pyx_filename = NULL;
15473  int __pyx_clineno = 0;
15474  __Pyx_RefNannySetupContext("__get__", 0);
15475  __Pyx_TraceCall("__get__", __pyx_f[1], 565, 0, __PYX_ERR(1, 565, __pyx_L1_error));
15476 
15477  /* "View.MemoryView":566
15478  * @property
15479  * def shape(self):
15480  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
15481  *
15482  * @property
15483  */
15484  __Pyx_TraceLine(566,0,__PYX_ERR(1, 566, __pyx_L1_error))
15485  __Pyx_XDECREF(__pyx_r);
15486  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 566, __pyx_L1_error)
15487  __Pyx_GOTREF(__pyx_t_1);
15488  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
15489  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
15490  __pyx_t_2 = __pyx_t_4;
15491  __pyx_v_length = (__pyx_t_2[0]);
15492  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
15493  __Pyx_GOTREF(__pyx_t_5);
15494  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 566, __pyx_L1_error)
15495  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15496  }
15497  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
15498  __Pyx_GOTREF(__pyx_t_5);
15499  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15500  __pyx_r = __pyx_t_5;
15501  __pyx_t_5 = 0;
15502  goto __pyx_L0;
15503 
15504  /* "View.MemoryView":565
15505  *
15506  * @property
15507  * def shape(self): # <<<<<<<<<<<<<<
15508  * return tuple([length for length in self.view.shape[:self.view.ndim]])
15509  *
15510  */
15511 
15512  /* function exit code */
15513  __pyx_L1_error:;
15514  __Pyx_XDECREF(__pyx_t_1);
15515  __Pyx_XDECREF(__pyx_t_5);
15516  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15517  __pyx_r = NULL;
15518  __pyx_L0:;
15519  __Pyx_XGIVEREF(__pyx_r);
15520  __Pyx_TraceReturn(__pyx_r, 0);
15521  __Pyx_RefNannyFinishContext();
15522  return __pyx_r;
15523 }
15524 
15525 /* "View.MemoryView":569
15526  *
15527  * @property
15528  * def strides(self): # <<<<<<<<<<<<<<
15529  * if self.view.strides == NULL:
15530  *
15531  */
15532 
15533 /* Python wrapper */
15534 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
15535 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
15536  PyObject *__pyx_r = 0;
15537  __Pyx_RefNannyDeclarations
15538  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15539  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15540 
15541  /* function exit code */
15542  __Pyx_RefNannyFinishContext();
15543  return __pyx_r;
15544 }
15545 
15546 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15547  Py_ssize_t __pyx_v_stride;
15548  PyObject *__pyx_r = NULL;
15549  __Pyx_TraceDeclarations
15550  __Pyx_RefNannyDeclarations
15551  int __pyx_t_1;
15552  PyObject *__pyx_t_2 = NULL;
15553  Py_ssize_t *__pyx_t_3;
15554  Py_ssize_t *__pyx_t_4;
15555  Py_ssize_t *__pyx_t_5;
15556  PyObject *__pyx_t_6 = NULL;
15557  int __pyx_lineno = 0;
15558  const char *__pyx_filename = NULL;
15559  int __pyx_clineno = 0;
15560  __Pyx_RefNannySetupContext("__get__", 0);
15561  __Pyx_TraceCall("__get__", __pyx_f[1], 569, 0, __PYX_ERR(1, 569, __pyx_L1_error));
15562 
15563  /* "View.MemoryView":570
15564  * @property
15565  * def strides(self):
15566  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
15567  *
15568  * raise ValueError("Buffer view does not expose strides")
15569  */
15570  __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
15571  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
15572  if (unlikely(__pyx_t_1)) {
15573 
15574  /* "View.MemoryView":572
15575  * if self.view.strides == NULL:
15576  *
15577  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
15578  *
15579  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
15580  */
15581  __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
15582  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
15583  __Pyx_GOTREF(__pyx_t_2);
15584  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
15585  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15586  __PYX_ERR(1, 572, __pyx_L1_error)
15587 
15588  /* "View.MemoryView":570
15589  * @property
15590  * def strides(self):
15591  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
15592  *
15593  * raise ValueError("Buffer view does not expose strides")
15594  */
15595  }
15596 
15597  /* "View.MemoryView":574
15598  * raise ValueError("Buffer view does not expose strides")
15599  *
15600  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
15601  *
15602  * @property
15603  */
15604  __Pyx_TraceLine(574,0,__PYX_ERR(1, 574, __pyx_L1_error))
15605  __Pyx_XDECREF(__pyx_r);
15606  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 574, __pyx_L1_error)
15607  __Pyx_GOTREF(__pyx_t_2);
15608  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
15609  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
15610  __pyx_t_3 = __pyx_t_5;
15611  __pyx_v_stride = (__pyx_t_3[0]);
15612  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
15613  __Pyx_GOTREF(__pyx_t_6);
15614  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 574, __pyx_L1_error)
15615  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
15616  }
15617  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 574, __pyx_L1_error)
15618  __Pyx_GOTREF(__pyx_t_6);
15619  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15620  __pyx_r = __pyx_t_6;
15621  __pyx_t_6 = 0;
15622  goto __pyx_L0;
15623 
15624  /* "View.MemoryView":569
15625  *
15626  * @property
15627  * def strides(self): # <<<<<<<<<<<<<<
15628  * if self.view.strides == NULL:
15629  *
15630  */
15631 
15632  /* function exit code */
15633  __pyx_L1_error:;
15634  __Pyx_XDECREF(__pyx_t_2);
15635  __Pyx_XDECREF(__pyx_t_6);
15636  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15637  __pyx_r = NULL;
15638  __pyx_L0:;
15639  __Pyx_XGIVEREF(__pyx_r);
15640  __Pyx_TraceReturn(__pyx_r, 0);
15641  __Pyx_RefNannyFinishContext();
15642  return __pyx_r;
15643 }
15644 
15645 /* "View.MemoryView":577
15646  *
15647  * @property
15648  * def suboffsets(self): # <<<<<<<<<<<<<<
15649  * if self.view.suboffsets == NULL:
15650  * return (-1,) * self.view.ndim
15651  */
15652 
15653 /* Python wrapper */
15654 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
15655 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
15656  PyObject *__pyx_r = 0;
15657  __Pyx_RefNannyDeclarations
15658  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15659  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15660 
15661  /* function exit code */
15662  __Pyx_RefNannyFinishContext();
15663  return __pyx_r;
15664 }
15665 
15666 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15667  Py_ssize_t __pyx_v_suboffset;
15668  PyObject *__pyx_r = NULL;
15669  __Pyx_TraceDeclarations
15670  __Pyx_RefNannyDeclarations
15671  int __pyx_t_1;
15672  PyObject *__pyx_t_2 = NULL;
15673  PyObject *__pyx_t_3 = NULL;
15674  Py_ssize_t *__pyx_t_4;
15675  Py_ssize_t *__pyx_t_5;
15676  Py_ssize_t *__pyx_t_6;
15677  int __pyx_lineno = 0;
15678  const char *__pyx_filename = NULL;
15679  int __pyx_clineno = 0;
15680  __Pyx_RefNannySetupContext("__get__", 0);
15681  __Pyx_TraceCall("__get__", __pyx_f[1], 577, 0, __PYX_ERR(1, 577, __pyx_L1_error));
15682 
15683  /* "View.MemoryView":578
15684  * @property
15685  * def suboffsets(self):
15686  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
15687  * return (-1,) * self.view.ndim
15688  *
15689  */
15690  __Pyx_TraceLine(578,0,__PYX_ERR(1, 578, __pyx_L1_error))
15691  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
15692  if (__pyx_t_1) {
15693 
15694  /* "View.MemoryView":579
15695  * def suboffsets(self):
15696  * if self.view.suboffsets == NULL:
15697  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
15698  *
15699  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
15700  */
15701  __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
15702  __Pyx_XDECREF(__pyx_r);
15703  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
15704  __Pyx_GOTREF(__pyx_t_2);
15705  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__19, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
15706  __Pyx_GOTREF(__pyx_t_3);
15707  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15708  __pyx_r = __pyx_t_3;
15709  __pyx_t_3 = 0;
15710  goto __pyx_L0;
15711 
15712  /* "View.MemoryView":578
15713  * @property
15714  * def suboffsets(self):
15715  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
15716  * return (-1,) * self.view.ndim
15717  *
15718  */
15719  }
15720 
15721  /* "View.MemoryView":581
15722  * return (-1,) * self.view.ndim
15723  *
15724  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
15725  *
15726  * @property
15727  */
15728  __Pyx_TraceLine(581,0,__PYX_ERR(1, 581, __pyx_L1_error))
15729  __Pyx_XDECREF(__pyx_r);
15730  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 581, __pyx_L1_error)
15731  __Pyx_GOTREF(__pyx_t_3);
15732  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
15733  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
15734  __pyx_t_4 = __pyx_t_6;
15735  __pyx_v_suboffset = (__pyx_t_4[0]);
15736  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
15737  __Pyx_GOTREF(__pyx_t_2);
15738  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 581, __pyx_L1_error)
15739  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15740  }
15741  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 581, __pyx_L1_error)
15742  __Pyx_GOTREF(__pyx_t_2);
15743  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15744  __pyx_r = __pyx_t_2;
15745  __pyx_t_2 = 0;
15746  goto __pyx_L0;
15747 
15748  /* "View.MemoryView":577
15749  *
15750  * @property
15751  * def suboffsets(self): # <<<<<<<<<<<<<<
15752  * if self.view.suboffsets == NULL:
15753  * return (-1,) * self.view.ndim
15754  */
15755 
15756  /* function exit code */
15757  __pyx_L1_error:;
15758  __Pyx_XDECREF(__pyx_t_2);
15759  __Pyx_XDECREF(__pyx_t_3);
15760  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15761  __pyx_r = NULL;
15762  __pyx_L0:;
15763  __Pyx_XGIVEREF(__pyx_r);
15764  __Pyx_TraceReturn(__pyx_r, 0);
15765  __Pyx_RefNannyFinishContext();
15766  return __pyx_r;
15767 }
15768 
15769 /* "View.MemoryView":584
15770  *
15771  * @property
15772  * def ndim(self): # <<<<<<<<<<<<<<
15773  * return self.view.ndim
15774  *
15775  */
15776 
15777 /* Python wrapper */
15778 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
15779 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
15780  PyObject *__pyx_r = 0;
15781  __Pyx_RefNannyDeclarations
15782  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15783  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15784 
15785  /* function exit code */
15786  __Pyx_RefNannyFinishContext();
15787  return __pyx_r;
15788 }
15789 
15790 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15791  PyObject *__pyx_r = NULL;
15792  __Pyx_TraceDeclarations
15793  __Pyx_RefNannyDeclarations
15794  PyObject *__pyx_t_1 = NULL;
15795  int __pyx_lineno = 0;
15796  const char *__pyx_filename = NULL;
15797  int __pyx_clineno = 0;
15798  __Pyx_RefNannySetupContext("__get__", 0);
15799  __Pyx_TraceCall("__get__", __pyx_f[1], 584, 0, __PYX_ERR(1, 584, __pyx_L1_error));
15800 
15801  /* "View.MemoryView":585
15802  * @property
15803  * def ndim(self):
15804  * return self.view.ndim # <<<<<<<<<<<<<<
15805  *
15806  * @property
15807  */
15808  __Pyx_TraceLine(585,0,__PYX_ERR(1, 585, __pyx_L1_error))
15809  __Pyx_XDECREF(__pyx_r);
15810  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 585, __pyx_L1_error)
15811  __Pyx_GOTREF(__pyx_t_1);
15812  __pyx_r = __pyx_t_1;
15813  __pyx_t_1 = 0;
15814  goto __pyx_L0;
15815 
15816  /* "View.MemoryView":584
15817  *
15818  * @property
15819  * def ndim(self): # <<<<<<<<<<<<<<
15820  * return self.view.ndim
15821  *
15822  */
15823 
15824  /* function exit code */
15825  __pyx_L1_error:;
15826  __Pyx_XDECREF(__pyx_t_1);
15827  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15828  __pyx_r = NULL;
15829  __pyx_L0:;
15830  __Pyx_XGIVEREF(__pyx_r);
15831  __Pyx_TraceReturn(__pyx_r, 0);
15832  __Pyx_RefNannyFinishContext();
15833  return __pyx_r;
15834 }
15835 
15836 /* "View.MemoryView":588
15837  *
15838  * @property
15839  * def itemsize(self): # <<<<<<<<<<<<<<
15840  * return self.view.itemsize
15841  *
15842  */
15843 
15844 /* Python wrapper */
15845 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
15846 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
15847  PyObject *__pyx_r = 0;
15848  __Pyx_RefNannyDeclarations
15849  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15850  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15851 
15852  /* function exit code */
15853  __Pyx_RefNannyFinishContext();
15854  return __pyx_r;
15855 }
15856 
15857 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15858  PyObject *__pyx_r = NULL;
15859  __Pyx_TraceDeclarations
15860  __Pyx_RefNannyDeclarations
15861  PyObject *__pyx_t_1 = NULL;
15862  int __pyx_lineno = 0;
15863  const char *__pyx_filename = NULL;
15864  int __pyx_clineno = 0;
15865  __Pyx_RefNannySetupContext("__get__", 0);
15866  __Pyx_TraceCall("__get__", __pyx_f[1], 588, 0, __PYX_ERR(1, 588, __pyx_L1_error));
15867 
15868  /* "View.MemoryView":589
15869  * @property
15870  * def itemsize(self):
15871  * return self.view.itemsize # <<<<<<<<<<<<<<
15872  *
15873  * @property
15874  */
15875  __Pyx_TraceLine(589,0,__PYX_ERR(1, 589, __pyx_L1_error))
15876  __Pyx_XDECREF(__pyx_r);
15877  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 589, __pyx_L1_error)
15878  __Pyx_GOTREF(__pyx_t_1);
15879  __pyx_r = __pyx_t_1;
15880  __pyx_t_1 = 0;
15881  goto __pyx_L0;
15882 
15883  /* "View.MemoryView":588
15884  *
15885  * @property
15886  * def itemsize(self): # <<<<<<<<<<<<<<
15887  * return self.view.itemsize
15888  *
15889  */
15890 
15891  /* function exit code */
15892  __pyx_L1_error:;
15893  __Pyx_XDECREF(__pyx_t_1);
15894  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15895  __pyx_r = NULL;
15896  __pyx_L0:;
15897  __Pyx_XGIVEREF(__pyx_r);
15898  __Pyx_TraceReturn(__pyx_r, 0);
15899  __Pyx_RefNannyFinishContext();
15900  return __pyx_r;
15901 }
15902 
15903 /* "View.MemoryView":592
15904  *
15905  * @property
15906  * def nbytes(self): # <<<<<<<<<<<<<<
15907  * return self.size * self.view.itemsize
15908  *
15909  */
15910 
15911 /* Python wrapper */
15912 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
15913 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
15914  PyObject *__pyx_r = 0;
15915  __Pyx_RefNannyDeclarations
15916  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15917  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15918 
15919  /* function exit code */
15920  __Pyx_RefNannyFinishContext();
15921  return __pyx_r;
15922 }
15923 
15924 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
15925  PyObject *__pyx_r = NULL;
15926  __Pyx_TraceDeclarations
15927  __Pyx_RefNannyDeclarations
15928  PyObject *__pyx_t_1 = NULL;
15929  PyObject *__pyx_t_2 = NULL;
15930  PyObject *__pyx_t_3 = NULL;
15931  int __pyx_lineno = 0;
15932  const char *__pyx_filename = NULL;
15933  int __pyx_clineno = 0;
15934  __Pyx_RefNannySetupContext("__get__", 0);
15935  __Pyx_TraceCall("__get__", __pyx_f[1], 592, 0, __PYX_ERR(1, 592, __pyx_L1_error));
15936 
15937  /* "View.MemoryView":593
15938  * @property
15939  * def nbytes(self):
15940  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
15941  *
15942  * @property
15943  */
15944  __Pyx_TraceLine(593,0,__PYX_ERR(1, 593, __pyx_L1_error))
15945  __Pyx_XDECREF(__pyx_r);
15946  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 593, __pyx_L1_error)
15947  __Pyx_GOTREF(__pyx_t_1);
15948  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 593, __pyx_L1_error)
15949  __Pyx_GOTREF(__pyx_t_2);
15950  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 593, __pyx_L1_error)
15951  __Pyx_GOTREF(__pyx_t_3);
15952  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15953  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15954  __pyx_r = __pyx_t_3;
15955  __pyx_t_3 = 0;
15956  goto __pyx_L0;
15957 
15958  /* "View.MemoryView":592
15959  *
15960  * @property
15961  * def nbytes(self): # <<<<<<<<<<<<<<
15962  * return self.size * self.view.itemsize
15963  *
15964  */
15965 
15966  /* function exit code */
15967  __pyx_L1_error:;
15968  __Pyx_XDECREF(__pyx_t_1);
15969  __Pyx_XDECREF(__pyx_t_2);
15970  __Pyx_XDECREF(__pyx_t_3);
15971  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15972  __pyx_r = NULL;
15973  __pyx_L0:;
15974  __Pyx_XGIVEREF(__pyx_r);
15975  __Pyx_TraceReturn(__pyx_r, 0);
15976  __Pyx_RefNannyFinishContext();
15977  return __pyx_r;
15978 }
15979 
15980 /* "View.MemoryView":596
15981  *
15982  * @property
15983  * def size(self): # <<<<<<<<<<<<<<
15984  * if self._size is None:
15985  * result = 1
15986  */
15987 
15988 /* Python wrapper */
15989 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
15990 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
15991  PyObject *__pyx_r = 0;
15992  __Pyx_RefNannyDeclarations
15993  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15994  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
15995 
15996  /* function exit code */
15997  __Pyx_RefNannyFinishContext();
15998  return __pyx_r;
15999 }
16000 
16001 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
16002  PyObject *__pyx_v_result = NULL;
16003  PyObject *__pyx_v_length = NULL;
16004  PyObject *__pyx_r = NULL;
16005  __Pyx_TraceDeclarations
16006  __Pyx_RefNannyDeclarations
16007  int __pyx_t_1;
16008  int __pyx_t_2;
16009  Py_ssize_t *__pyx_t_3;
16010  Py_ssize_t *__pyx_t_4;
16011  Py_ssize_t *__pyx_t_5;
16012  PyObject *__pyx_t_6 = NULL;
16013  int __pyx_lineno = 0;
16014  const char *__pyx_filename = NULL;
16015  int __pyx_clineno = 0;
16016  __Pyx_RefNannySetupContext("__get__", 0);
16017  __Pyx_TraceCall("__get__", __pyx_f[1], 596, 0, __PYX_ERR(1, 596, __pyx_L1_error));
16018 
16019  /* "View.MemoryView":597
16020  * @property
16021  * def size(self):
16022  * if self._size is None: # <<<<<<<<<<<<<<
16023  * result = 1
16024  *
16025  */
16026  __Pyx_TraceLine(597,0,__PYX_ERR(1, 597, __pyx_L1_error))
16027  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
16028  __pyx_t_2 = (__pyx_t_1 != 0);
16029  if (__pyx_t_2) {
16030 
16031  /* "View.MemoryView":598
16032  * def size(self):
16033  * if self._size is None:
16034  * result = 1 # <<<<<<<<<<<<<<
16035  *
16036  * for length in self.view.shape[:self.view.ndim]:
16037  */
16038  __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
16039  __Pyx_INCREF(__pyx_int_1);
16040  __pyx_v_result = __pyx_int_1;
16041 
16042  /* "View.MemoryView":600
16043  * result = 1
16044  *
16045  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
16046  * result *= length
16047  *
16048  */
16049  __Pyx_TraceLine(600,0,__PYX_ERR(1, 600, __pyx_L1_error))
16050  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
16051  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
16052  __pyx_t_3 = __pyx_t_5;
16053  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 600, __pyx_L1_error)
16054  __Pyx_GOTREF(__pyx_t_6);
16055  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
16056  __pyx_t_6 = 0;
16057 
16058  /* "View.MemoryView":601
16059  *
16060  * for length in self.view.shape[:self.view.ndim]:
16061  * result *= length # <<<<<<<<<<<<<<
16062  *
16063  * self._size = result
16064  */
16065  __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
16066  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 601, __pyx_L1_error)
16067  __Pyx_GOTREF(__pyx_t_6);
16068  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
16069  __pyx_t_6 = 0;
16070  }
16071 
16072  /* "View.MemoryView":603
16073  * result *= length
16074  *
16075  * self._size = result # <<<<<<<<<<<<<<
16076  *
16077  * return self._size
16078  */
16079  __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
16080  __Pyx_INCREF(__pyx_v_result);
16081  __Pyx_GIVEREF(__pyx_v_result);
16082  __Pyx_GOTREF(__pyx_v_self->_size);
16083  __Pyx_DECREF(__pyx_v_self->_size);
16084  __pyx_v_self->_size = __pyx_v_result;
16085 
16086  /* "View.MemoryView":597
16087  * @property
16088  * def size(self):
16089  * if self._size is None: # <<<<<<<<<<<<<<
16090  * result = 1
16091  *
16092  */
16093  }
16094 
16095  /* "View.MemoryView":605
16096  * self._size = result
16097  *
16098  * return self._size # <<<<<<<<<<<<<<
16099  *
16100  * def __len__(self):
16101  */
16102  __Pyx_TraceLine(605,0,__PYX_ERR(1, 605, __pyx_L1_error))
16103  __Pyx_XDECREF(__pyx_r);
16104  __Pyx_INCREF(__pyx_v_self->_size);
16105  __pyx_r = __pyx_v_self->_size;
16106  goto __pyx_L0;
16107 
16108  /* "View.MemoryView":596
16109  *
16110  * @property
16111  * def size(self): # <<<<<<<<<<<<<<
16112  * if self._size is None:
16113  * result = 1
16114  */
16115 
16116  /* function exit code */
16117  __pyx_L1_error:;
16118  __Pyx_XDECREF(__pyx_t_6);
16119  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16120  __pyx_r = NULL;
16121  __pyx_L0:;
16122  __Pyx_XDECREF(__pyx_v_result);
16123  __Pyx_XDECREF(__pyx_v_length);
16124  __Pyx_XGIVEREF(__pyx_r);
16125  __Pyx_TraceReturn(__pyx_r, 0);
16126  __Pyx_RefNannyFinishContext();
16127  return __pyx_r;
16128 }
16129 
16130 /* "View.MemoryView":607
16131  * return self._size
16132  *
16133  * def __len__(self): # <<<<<<<<<<<<<<
16134  * if self.view.ndim >= 1:
16135  * return self.view.shape[0]
16136  */
16137 
16138 /* Python wrapper */
16139 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
16140 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
16141  Py_ssize_t __pyx_r;
16142  __Pyx_RefNannyDeclarations
16143  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
16144  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16145 
16146  /* function exit code */
16147  __Pyx_RefNannyFinishContext();
16148  return __pyx_r;
16149 }
16150 
16151 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
16152  Py_ssize_t __pyx_r;
16153  __Pyx_TraceDeclarations
16154  __Pyx_RefNannyDeclarations
16155  int __pyx_t_1;
16156  int __pyx_lineno = 0;
16157  const char *__pyx_filename = NULL;
16158  int __pyx_clineno = 0;
16159  __Pyx_RefNannySetupContext("__len__", 0);
16160  __Pyx_TraceCall("__len__", __pyx_f[1], 607, 0, __PYX_ERR(1, 607, __pyx_L1_error));
16161 
16162  /* "View.MemoryView":608
16163  *
16164  * def __len__(self):
16165  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
16166  * return self.view.shape[0]
16167  *
16168  */
16169  __Pyx_TraceLine(608,0,__PYX_ERR(1, 608, __pyx_L1_error))
16170  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
16171  if (__pyx_t_1) {
16172 
16173  /* "View.MemoryView":609
16174  * def __len__(self):
16175  * if self.view.ndim >= 1:
16176  * return self.view.shape[0] # <<<<<<<<<<<<<<
16177  *
16178  * return 0
16179  */
16180  __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
16181  __pyx_r = (__pyx_v_self->view.shape[0]);
16182  goto __pyx_L0;
16183 
16184  /* "View.MemoryView":608
16185  *
16186  * def __len__(self):
16187  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
16188  * return self.view.shape[0]
16189  *
16190  */
16191  }
16192 
16193  /* "View.MemoryView":611
16194  * return self.view.shape[0]
16195  *
16196  * return 0 # <<<<<<<<<<<<<<
16197  *
16198  * def __repr__(self):
16199  */
16200  __Pyx_TraceLine(611,0,__PYX_ERR(1, 611, __pyx_L1_error))
16201  __pyx_r = 0;
16202  goto __pyx_L0;
16203 
16204  /* "View.MemoryView":607
16205  * return self._size
16206  *
16207  * def __len__(self): # <<<<<<<<<<<<<<
16208  * if self.view.ndim >= 1:
16209  * return self.view.shape[0]
16210  */
16211 
16212  /* function exit code */
16213  __pyx_L1_error:;
16214  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16215  __pyx_r = -1;
16216  __pyx_L0:;
16217  __Pyx_TraceReturn(Py_None, 0);
16218  __Pyx_RefNannyFinishContext();
16219  return __pyx_r;
16220 }
16221 
16222 /* "View.MemoryView":613
16223  * return 0
16224  *
16225  * def __repr__(self): # <<<<<<<<<<<<<<
16226  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
16227  * id(self))
16228  */
16229 
16230 /* Python wrapper */
16231 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
16232 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
16233  PyObject *__pyx_r = 0;
16234  __Pyx_RefNannyDeclarations
16235  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
16236  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16237 
16238  /* function exit code */
16239  __Pyx_RefNannyFinishContext();
16240  return __pyx_r;
16241 }
16242 
16243 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
16244  PyObject *__pyx_r = NULL;
16245  __Pyx_TraceDeclarations
16246  __Pyx_RefNannyDeclarations
16247  PyObject *__pyx_t_1 = NULL;
16248  PyObject *__pyx_t_2 = NULL;
16249  PyObject *__pyx_t_3 = NULL;
16250  int __pyx_lineno = 0;
16251  const char *__pyx_filename = NULL;
16252  int __pyx_clineno = 0;
16253  __Pyx_RefNannySetupContext("__repr__", 0);
16254  __Pyx_TraceCall("__repr__", __pyx_f[1], 613, 0, __PYX_ERR(1, 613, __pyx_L1_error));
16255 
16256  /* "View.MemoryView":614
16257  *
16258  * def __repr__(self):
16259  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
16260  * id(self))
16261  *
16262  */
16263  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
16264  __Pyx_XDECREF(__pyx_r);
16265  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
16266  __Pyx_GOTREF(__pyx_t_1);
16267  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
16268  __Pyx_GOTREF(__pyx_t_2);
16269  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16270  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 614, __pyx_L1_error)
16271  __Pyx_GOTREF(__pyx_t_1);
16272  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16273 
16274  /* "View.MemoryView":615
16275  * def __repr__(self):
16276  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
16277  * id(self)) # <<<<<<<<<<<<<<
16278  *
16279  * def __str__(self):
16280  */
16281  __Pyx_TraceLine(615,0,__PYX_ERR(1, 615, __pyx_L1_error))
16282  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 615, __pyx_L1_error)
16283  __Pyx_GOTREF(__pyx_t_2);
16284 
16285  /* "View.MemoryView":614
16286  *
16287  * def __repr__(self):
16288  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
16289  * id(self))
16290  *
16291  */
16292  __Pyx_TraceLine(614,0,__PYX_ERR(1, 614, __pyx_L1_error))
16293  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 614, __pyx_L1_error)
16294  __Pyx_GOTREF(__pyx_t_3);
16295  __Pyx_GIVEREF(__pyx_t_1);
16296  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
16297  __Pyx_GIVEREF(__pyx_t_2);
16298  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
16299  __pyx_t_1 = 0;
16300  __pyx_t_2 = 0;
16301  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 614, __pyx_L1_error)
16302  __Pyx_GOTREF(__pyx_t_2);
16303  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16304  __pyx_r = __pyx_t_2;
16305  __pyx_t_2 = 0;
16306  goto __pyx_L0;
16307 
16308  /* "View.MemoryView":613
16309  * return 0
16310  *
16311  * def __repr__(self): # <<<<<<<<<<<<<<
16312  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
16313  * id(self))
16314  */
16315 
16316  /* function exit code */
16317  __pyx_L1_error:;
16318  __Pyx_XDECREF(__pyx_t_1);
16319  __Pyx_XDECREF(__pyx_t_2);
16320  __Pyx_XDECREF(__pyx_t_3);
16321  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16322  __pyx_r = NULL;
16323  __pyx_L0:;
16324  __Pyx_XGIVEREF(__pyx_r);
16325  __Pyx_TraceReturn(__pyx_r, 0);
16326  __Pyx_RefNannyFinishContext();
16327  return __pyx_r;
16328 }
16329 
16330 /* "View.MemoryView":617
16331  * id(self))
16332  *
16333  * def __str__(self): # <<<<<<<<<<<<<<
16334  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
16335  *
16336  */
16337 
16338 /* Python wrapper */
16339 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
16340 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
16341  PyObject *__pyx_r = 0;
16342  __Pyx_RefNannyDeclarations
16343  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
16344  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16345 
16346  /* function exit code */
16347  __Pyx_RefNannyFinishContext();
16348  return __pyx_r;
16349 }
16350 
16351 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
16352  PyObject *__pyx_r = NULL;
16353  __Pyx_TraceDeclarations
16354  __Pyx_RefNannyDeclarations
16355  PyObject *__pyx_t_1 = NULL;
16356  PyObject *__pyx_t_2 = NULL;
16357  int __pyx_lineno = 0;
16358  const char *__pyx_filename = NULL;
16359  int __pyx_clineno = 0;
16360  __Pyx_RefNannySetupContext("__str__", 0);
16361  __Pyx_TraceCall("__str__", __pyx_f[1], 617, 0, __PYX_ERR(1, 617, __pyx_L1_error));
16362 
16363  /* "View.MemoryView":618
16364  *
16365  * def __str__(self):
16366  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
16367  *
16368  *
16369  */
16370  __Pyx_TraceLine(618,0,__PYX_ERR(1, 618, __pyx_L1_error))
16371  __Pyx_XDECREF(__pyx_r);
16372  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
16373  __Pyx_GOTREF(__pyx_t_1);
16374  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
16375  __Pyx_GOTREF(__pyx_t_2);
16376  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16377  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
16378  __Pyx_GOTREF(__pyx_t_1);
16379  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16380  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
16381  __Pyx_GOTREF(__pyx_t_2);
16382  __Pyx_GIVEREF(__pyx_t_1);
16383  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
16384  __pyx_t_1 = 0;
16385  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 618, __pyx_L1_error)
16386  __Pyx_GOTREF(__pyx_t_1);
16387  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16388  __pyx_r = __pyx_t_1;
16389  __pyx_t_1 = 0;
16390  goto __pyx_L0;
16391 
16392  /* "View.MemoryView":617
16393  * id(self))
16394  *
16395  * def __str__(self): # <<<<<<<<<<<<<<
16396  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
16397  *
16398  */
16399 
16400  /* function exit code */
16401  __pyx_L1_error:;
16402  __Pyx_XDECREF(__pyx_t_1);
16403  __Pyx_XDECREF(__pyx_t_2);
16404  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16405  __pyx_r = NULL;
16406  __pyx_L0:;
16407  __Pyx_XGIVEREF(__pyx_r);
16408  __Pyx_TraceReturn(__pyx_r, 0);
16409  __Pyx_RefNannyFinishContext();
16410  return __pyx_r;
16411 }
16412 
16413 /* "View.MemoryView":621
16414  *
16415  *
16416  * def is_c_contig(self): # <<<<<<<<<<<<<<
16417  * cdef __Pyx_memviewslice *mslice
16418  * cdef __Pyx_memviewslice tmp
16419  */
16420 
16421 /* Python wrapper */
16422 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16423 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
16424 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16425  PyObject *__pyx_r = 0;
16426  __Pyx_RefNannyDeclarations
16427  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
16428  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
16429 
16430  /* function exit code */
16431  __Pyx_RefNannyFinishContext();
16432  return __pyx_r;
16433 }
16434 
16435 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
16436  __Pyx_memviewslice *__pyx_v_mslice;
16437  __Pyx_memviewslice __pyx_v_tmp;
16438  PyObject *__pyx_r = NULL;
16439  __Pyx_TraceDeclarations
16440  __Pyx_RefNannyDeclarations
16441  __Pyx_memviewslice *__pyx_t_1;
16442  PyObject *__pyx_t_2 = NULL;
16443  int __pyx_lineno = 0;
16444  const char *__pyx_filename = NULL;
16445  int __pyx_clineno = 0;
16446  __Pyx_RefNannySetupContext("is_c_contig", 0);
16447  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 621, 0, __PYX_ERR(1, 621, __pyx_L1_error));
16448 
16449  /* "View.MemoryView":624
16450  * cdef __Pyx_memviewslice *mslice
16451  * cdef __Pyx_memviewslice tmp
16452  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
16453  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
16454  *
16455  */
16456  __Pyx_TraceLine(624,0,__PYX_ERR(1, 624, __pyx_L1_error))
16457  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 624, __pyx_L1_error)
16458  __pyx_v_mslice = __pyx_t_1;
16459 
16460  /* "View.MemoryView":625
16461  * cdef __Pyx_memviewslice tmp
16462  * mslice = get_slice_from_memview(self, &tmp)
16463  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
16464  *
16465  * def is_f_contig(self):
16466  */
16467  __Pyx_TraceLine(625,0,__PYX_ERR(1, 625, __pyx_L1_error))
16468  __Pyx_XDECREF(__pyx_r);
16469  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 625, __pyx_L1_error)
16470  __Pyx_GOTREF(__pyx_t_2);
16471  __pyx_r = __pyx_t_2;
16472  __pyx_t_2 = 0;
16473  goto __pyx_L0;
16474 
16475  /* "View.MemoryView":621
16476  *
16477  *
16478  * def is_c_contig(self): # <<<<<<<<<<<<<<
16479  * cdef __Pyx_memviewslice *mslice
16480  * cdef __Pyx_memviewslice tmp
16481  */
16482 
16483  /* function exit code */
16484  __pyx_L1_error:;
16485  __Pyx_XDECREF(__pyx_t_2);
16486  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
16487  __pyx_r = NULL;
16488  __pyx_L0:;
16489  __Pyx_XGIVEREF(__pyx_r);
16490  __Pyx_TraceReturn(__pyx_r, 0);
16491  __Pyx_RefNannyFinishContext();
16492  return __pyx_r;
16493 }
16494 
16495 /* "View.MemoryView":627
16496  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
16497  *
16498  * def is_f_contig(self): # <<<<<<<<<<<<<<
16499  * cdef __Pyx_memviewslice *mslice
16500  * cdef __Pyx_memviewslice tmp
16501  */
16502 
16503 /* Python wrapper */
16504 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16505 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
16506 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16507  PyObject *__pyx_r = 0;
16508  __Pyx_RefNannyDeclarations
16509  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
16510  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
16511 
16512  /* function exit code */
16513  __Pyx_RefNannyFinishContext();
16514  return __pyx_r;
16515 }
16516 
16517 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
16518  __Pyx_memviewslice *__pyx_v_mslice;
16519  __Pyx_memviewslice __pyx_v_tmp;
16520  PyObject *__pyx_r = NULL;
16521  __Pyx_TraceDeclarations
16522  __Pyx_RefNannyDeclarations
16523  __Pyx_memviewslice *__pyx_t_1;
16524  PyObject *__pyx_t_2 = NULL;
16525  int __pyx_lineno = 0;
16526  const char *__pyx_filename = NULL;
16527  int __pyx_clineno = 0;
16528  __Pyx_RefNannySetupContext("is_f_contig", 0);
16529  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 627, 0, __PYX_ERR(1, 627, __pyx_L1_error));
16530 
16531  /* "View.MemoryView":630
16532  * cdef __Pyx_memviewslice *mslice
16533  * cdef __Pyx_memviewslice tmp
16534  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
16535  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
16536  *
16537  */
16538  __Pyx_TraceLine(630,0,__PYX_ERR(1, 630, __pyx_L1_error))
16539  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 630, __pyx_L1_error)
16540  __pyx_v_mslice = __pyx_t_1;
16541 
16542  /* "View.MemoryView":631
16543  * cdef __Pyx_memviewslice tmp
16544  * mslice = get_slice_from_memview(self, &tmp)
16545  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
16546  *
16547  * def copy(self):
16548  */
16549  __Pyx_TraceLine(631,0,__PYX_ERR(1, 631, __pyx_L1_error))
16550  __Pyx_XDECREF(__pyx_r);
16551  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 631, __pyx_L1_error)
16552  __Pyx_GOTREF(__pyx_t_2);
16553  __pyx_r = __pyx_t_2;
16554  __pyx_t_2 = 0;
16555  goto __pyx_L0;
16556 
16557  /* "View.MemoryView":627
16558  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
16559  *
16560  * def is_f_contig(self): # <<<<<<<<<<<<<<
16561  * cdef __Pyx_memviewslice *mslice
16562  * cdef __Pyx_memviewslice tmp
16563  */
16564 
16565  /* function exit code */
16566  __pyx_L1_error:;
16567  __Pyx_XDECREF(__pyx_t_2);
16568  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
16569  __pyx_r = NULL;
16570  __pyx_L0:;
16571  __Pyx_XGIVEREF(__pyx_r);
16572  __Pyx_TraceReturn(__pyx_r, 0);
16573  __Pyx_RefNannyFinishContext();
16574  return __pyx_r;
16575 }
16576 
16577 /* "View.MemoryView":633
16578  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
16579  *
16580  * def copy(self): # <<<<<<<<<<<<<<
16581  * cdef __Pyx_memviewslice mslice
16582  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
16583  */
16584 
16585 /* Python wrapper */
16586 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16587 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
16588 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16589  PyObject *__pyx_r = 0;
16590  __Pyx_RefNannyDeclarations
16591  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
16592  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
16593 
16594  /* function exit code */
16595  __Pyx_RefNannyFinishContext();
16596  return __pyx_r;
16597 }
16598 
16599 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
16600  __Pyx_memviewslice __pyx_v_mslice;
16601  int __pyx_v_flags;
16602  PyObject *__pyx_r = NULL;
16603  __Pyx_TraceDeclarations
16604  __Pyx_RefNannyDeclarations
16605  __Pyx_memviewslice __pyx_t_1;
16606  PyObject *__pyx_t_2 = NULL;
16607  int __pyx_lineno = 0;
16608  const char *__pyx_filename = NULL;
16609  int __pyx_clineno = 0;
16610  __Pyx_RefNannySetupContext("copy", 0);
16611  __Pyx_TraceCall("copy", __pyx_f[1], 633, 0, __PYX_ERR(1, 633, __pyx_L1_error));
16612 
16613  /* "View.MemoryView":635
16614  * def copy(self):
16615  * cdef __Pyx_memviewslice mslice
16616  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
16617  *
16618  * slice_copy(self, &mslice)
16619  */
16620  __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
16621  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
16622 
16623  /* "View.MemoryView":637
16624  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
16625  *
16626  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
16627  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
16628  * self.view.itemsize,
16629  */
16630  __Pyx_TraceLine(637,0,__PYX_ERR(1, 637, __pyx_L1_error))
16631  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
16632 
16633  /* "View.MemoryView":638
16634  *
16635  * slice_copy(self, &mslice)
16636  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
16637  * self.view.itemsize,
16638  * flags|PyBUF_C_CONTIGUOUS,
16639  */
16640  __Pyx_TraceLine(638,0,__PYX_ERR(1, 638, __pyx_L1_error))
16641  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 638, __pyx_L1_error)
16642  __pyx_v_mslice = __pyx_t_1;
16643 
16644  /* "View.MemoryView":643
16645  * self.dtype_is_object)
16646  *
16647  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
16648  *
16649  * def copy_fortran(self):
16650  */
16651  __Pyx_TraceLine(643,0,__PYX_ERR(1, 643, __pyx_L1_error))
16652  __Pyx_XDECREF(__pyx_r);
16653  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 643, __pyx_L1_error)
16654  __Pyx_GOTREF(__pyx_t_2);
16655  __pyx_r = __pyx_t_2;
16656  __pyx_t_2 = 0;
16657  goto __pyx_L0;
16658 
16659  /* "View.MemoryView":633
16660  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
16661  *
16662  * def copy(self): # <<<<<<<<<<<<<<
16663  * cdef __Pyx_memviewslice mslice
16664  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
16665  */
16666 
16667  /* function exit code */
16668  __pyx_L1_error:;
16669  __Pyx_XDECREF(__pyx_t_2);
16670  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16671  __pyx_r = NULL;
16672  __pyx_L0:;
16673  __Pyx_XGIVEREF(__pyx_r);
16674  __Pyx_TraceReturn(__pyx_r, 0);
16675  __Pyx_RefNannyFinishContext();
16676  return __pyx_r;
16677 }
16678 
16679 /* "View.MemoryView":645
16680  * return memoryview_copy_from_slice(self, &mslice)
16681  *
16682  * def copy_fortran(self): # <<<<<<<<<<<<<<
16683  * cdef __Pyx_memviewslice src, dst
16684  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
16685  */
16686 
16687 /* Python wrapper */
16688 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16689 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
16690 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16691  PyObject *__pyx_r = 0;
16692  __Pyx_RefNannyDeclarations
16693  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
16694  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
16695 
16696  /* function exit code */
16697  __Pyx_RefNannyFinishContext();
16698  return __pyx_r;
16699 }
16700 
16701 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
16702  __Pyx_memviewslice __pyx_v_src;
16703  __Pyx_memviewslice __pyx_v_dst;
16704  int __pyx_v_flags;
16705  PyObject *__pyx_r = NULL;
16706  __Pyx_TraceDeclarations
16707  __Pyx_RefNannyDeclarations
16708  __Pyx_memviewslice __pyx_t_1;
16709  PyObject *__pyx_t_2 = NULL;
16710  int __pyx_lineno = 0;
16711  const char *__pyx_filename = NULL;
16712  int __pyx_clineno = 0;
16713  __Pyx_RefNannySetupContext("copy_fortran", 0);
16714  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 645, 0, __PYX_ERR(1, 645, __pyx_L1_error));
16715 
16716  /* "View.MemoryView":647
16717  * def copy_fortran(self):
16718  * cdef __Pyx_memviewslice src, dst
16719  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
16720  *
16721  * slice_copy(self, &src)
16722  */
16723  __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
16724  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
16725 
16726  /* "View.MemoryView":649
16727  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
16728  *
16729  * slice_copy(self, &src) # <<<<<<<<<<<<<<
16730  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
16731  * self.view.itemsize,
16732  */
16733  __Pyx_TraceLine(649,0,__PYX_ERR(1, 649, __pyx_L1_error))
16734  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
16735 
16736  /* "View.MemoryView":650
16737  *
16738  * slice_copy(self, &src)
16739  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
16740  * self.view.itemsize,
16741  * flags|PyBUF_F_CONTIGUOUS,
16742  */
16743  __Pyx_TraceLine(650,0,__PYX_ERR(1, 650, __pyx_L1_error))
16744  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 650, __pyx_L1_error)
16745  __pyx_v_dst = __pyx_t_1;
16746 
16747  /* "View.MemoryView":655
16748  * self.dtype_is_object)
16749  *
16750  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
16751  *
16752  *
16753  */
16754  __Pyx_TraceLine(655,0,__PYX_ERR(1, 655, __pyx_L1_error))
16755  __Pyx_XDECREF(__pyx_r);
16756  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 655, __pyx_L1_error)
16757  __Pyx_GOTREF(__pyx_t_2);
16758  __pyx_r = __pyx_t_2;
16759  __pyx_t_2 = 0;
16760  goto __pyx_L0;
16761 
16762  /* "View.MemoryView":645
16763  * return memoryview_copy_from_slice(self, &mslice)
16764  *
16765  * def copy_fortran(self): # <<<<<<<<<<<<<<
16766  * cdef __Pyx_memviewslice src, dst
16767  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
16768  */
16769 
16770  /* function exit code */
16771  __pyx_L1_error:;
16772  __Pyx_XDECREF(__pyx_t_2);
16773  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
16774  __pyx_r = NULL;
16775  __pyx_L0:;
16776  __Pyx_XGIVEREF(__pyx_r);
16777  __Pyx_TraceReturn(__pyx_r, 0);
16778  __Pyx_RefNannyFinishContext();
16779  return __pyx_r;
16780 }
16781 
16782 /* "(tree fragment)":1
16783  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16784  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16785  * def __setstate_cython__(self, __pyx_state):
16786  */
16787 
16788 /* Python wrapper */
16789 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16790 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
16791 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16792  PyObject *__pyx_r = 0;
16793  __Pyx_RefNannyDeclarations
16794  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16795  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
16796 
16797  /* function exit code */
16798  __Pyx_RefNannyFinishContext();
16799  return __pyx_r;
16800 }
16801 
16802 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
16803  PyObject *__pyx_r = NULL;
16804  __Pyx_TraceDeclarations
16805  __Pyx_RefNannyDeclarations
16806  PyObject *__pyx_t_1 = NULL;
16807  int __pyx_lineno = 0;
16808  const char *__pyx_filename = NULL;
16809  int __pyx_clineno = 0;
16810  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
16811  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
16812 
16813  /* "(tree fragment)":2
16814  * def __reduce_cython__(self):
16815  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16816  * def __setstate_cython__(self, __pyx_state):
16817  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16818  */
16819  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
16820  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16821  __Pyx_GOTREF(__pyx_t_1);
16822  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16823  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16824  __PYX_ERR(1, 2, __pyx_L1_error)
16825 
16826  /* "(tree fragment)":1
16827  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16828  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16829  * def __setstate_cython__(self, __pyx_state):
16830  */
16831 
16832  /* function exit code */
16833  __pyx_L1_error:;
16834  __Pyx_XDECREF(__pyx_t_1);
16835  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16836  __pyx_r = NULL;
16837  __Pyx_XGIVEREF(__pyx_r);
16838  __Pyx_TraceReturn(__pyx_r, 0);
16839  __Pyx_RefNannyFinishContext();
16840  return __pyx_r;
16841 }
16842 
16843 /* "(tree fragment)":3
16844  * def __reduce_cython__(self):
16845  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16846  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16847  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16848  */
16849 
16850 /* Python wrapper */
16851 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
16852 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
16853 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16854  PyObject *__pyx_r = 0;
16855  __Pyx_RefNannyDeclarations
16856  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16857  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16858 
16859  /* function exit code */
16860  __Pyx_RefNannyFinishContext();
16861  return __pyx_r;
16862 }
16863 
16864 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16865  PyObject *__pyx_r = NULL;
16866  __Pyx_TraceDeclarations
16867  __Pyx_RefNannyDeclarations
16868  PyObject *__pyx_t_1 = NULL;
16869  int __pyx_lineno = 0;
16870  const char *__pyx_filename = NULL;
16871  int __pyx_clineno = 0;
16872  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
16873  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
16874 
16875  /* "(tree fragment)":4
16876  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16877  * def __setstate_cython__(self, __pyx_state):
16878  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16879  */
16880  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
16881  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16882  __Pyx_GOTREF(__pyx_t_1);
16883  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16884  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16885  __PYX_ERR(1, 4, __pyx_L1_error)
16886 
16887  /* "(tree fragment)":3
16888  * def __reduce_cython__(self):
16889  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16890  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16891  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16892  */
16893 
16894  /* function exit code */
16895  __pyx_L1_error:;
16896  __Pyx_XDECREF(__pyx_t_1);
16897  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16898  __pyx_r = NULL;
16899  __Pyx_XGIVEREF(__pyx_r);
16900  __Pyx_TraceReturn(__pyx_r, 0);
16901  __Pyx_RefNannyFinishContext();
16902  return __pyx_r;
16903 }
16904 
16905 /* "View.MemoryView":659
16906  *
16907  * @cname('__pyx_memoryview_new')
16908  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
16909  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
16910  * result.typeinfo = typeinfo
16911  */
16912 
16913 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
16914  struct __pyx_memoryview_obj *__pyx_v_result = 0;
16915  PyObject *__pyx_r = NULL;
16916  __Pyx_TraceDeclarations
16917  __Pyx_RefNannyDeclarations
16918  PyObject *__pyx_t_1 = NULL;
16919  PyObject *__pyx_t_2 = NULL;
16920  PyObject *__pyx_t_3 = NULL;
16921  int __pyx_lineno = 0;
16922  const char *__pyx_filename = NULL;
16923  int __pyx_clineno = 0;
16924  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
16925  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 659, 0, __PYX_ERR(1, 659, __pyx_L1_error));
16926 
16927  /* "View.MemoryView":660
16928  * @cname('__pyx_memoryview_new')
16929  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
16930  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
16931  * result.typeinfo = typeinfo
16932  * return result
16933  */
16934  __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
16935  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 660, __pyx_L1_error)
16936  __Pyx_GOTREF(__pyx_t_1);
16937  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
16938  __Pyx_GOTREF(__pyx_t_2);
16939  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
16940  __Pyx_GOTREF(__pyx_t_3);
16941  __Pyx_INCREF(__pyx_v_o);
16942  __Pyx_GIVEREF(__pyx_v_o);
16943  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
16944  __Pyx_GIVEREF(__pyx_t_1);
16945  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
16946  __Pyx_GIVEREF(__pyx_t_2);
16947  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
16948  __pyx_t_1 = 0;
16949  __pyx_t_2 = 0;
16950  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 660, __pyx_L1_error)
16951  __Pyx_GOTREF(__pyx_t_2);
16952  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16953  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
16954  __pyx_t_2 = 0;
16955 
16956  /* "View.MemoryView":661
16957  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
16958  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
16959  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
16960  * return result
16961  *
16962  */
16963  __Pyx_TraceLine(661,0,__PYX_ERR(1, 661, __pyx_L1_error))
16964  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
16965 
16966  /* "View.MemoryView":662
16967  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
16968  * result.typeinfo = typeinfo
16969  * return result # <<<<<<<<<<<<<<
16970  *
16971  * @cname('__pyx_memoryview_check')
16972  */
16973  __Pyx_TraceLine(662,0,__PYX_ERR(1, 662, __pyx_L1_error))
16974  __Pyx_XDECREF(__pyx_r);
16975  __Pyx_INCREF(((PyObject *)__pyx_v_result));
16976  __pyx_r = ((PyObject *)__pyx_v_result);
16977  goto __pyx_L0;
16978 
16979  /* "View.MemoryView":659
16980  *
16981  * @cname('__pyx_memoryview_new')
16982  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
16983  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
16984  * result.typeinfo = typeinfo
16985  */
16986 
16987  /* function exit code */
16988  __pyx_L1_error:;
16989  __Pyx_XDECREF(__pyx_t_1);
16990  __Pyx_XDECREF(__pyx_t_2);
16991  __Pyx_XDECREF(__pyx_t_3);
16992  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
16993  __pyx_r = 0;
16994  __pyx_L0:;
16995  __Pyx_XDECREF((PyObject *)__pyx_v_result);
16996  __Pyx_XGIVEREF(__pyx_r);
16997  __Pyx_TraceReturn(__pyx_r, 0);
16998  __Pyx_RefNannyFinishContext();
16999  return __pyx_r;
17000 }
17001 
17002 /* "View.MemoryView":665
17003  *
17004  * @cname('__pyx_memoryview_check')
17005  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
17006  * return isinstance(o, memoryview)
17007  *
17008  */
17009 
17010 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
17011  int __pyx_r;
17012  __Pyx_TraceDeclarations
17013  __Pyx_RefNannyDeclarations
17014  int __pyx_t_1;
17015  int __pyx_lineno = 0;
17016  const char *__pyx_filename = NULL;
17017  int __pyx_clineno = 0;
17018  __Pyx_RefNannySetupContext("memoryview_check", 0);
17019  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 665, 0, __PYX_ERR(1, 665, __pyx_L1_error));
17020 
17021  /* "View.MemoryView":666
17022  * @cname('__pyx_memoryview_check')
17023  * cdef inline bint memoryview_check(object o):
17024  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
17025  *
17026  * cdef tuple _unellipsify(object index, int ndim):
17027  */
17028  __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
17029  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
17030  __pyx_r = __pyx_t_1;
17031  goto __pyx_L0;
17032 
17033  /* "View.MemoryView":665
17034  *
17035  * @cname('__pyx_memoryview_check')
17036  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
17037  * return isinstance(o, memoryview)
17038  *
17039  */
17040 
17041  /* function exit code */
17042  __pyx_L1_error:;
17043  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17044  __pyx_r = 0;
17045  __pyx_L0:;
17046  __Pyx_TraceReturn(Py_None, 0);
17047  __Pyx_RefNannyFinishContext();
17048  return __pyx_r;
17049 }
17050 
17051 /* "View.MemoryView":668
17052  * return isinstance(o, memoryview)
17053  *
17054  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
17055  * """
17056  * Replace all ellipses with full slices and fill incomplete indices with
17057  */
17058 
17059 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
17060  PyObject *__pyx_v_tup = NULL;
17061  PyObject *__pyx_v_result = NULL;
17062  int __pyx_v_have_slices;
17063  int __pyx_v_seen_ellipsis;
17064  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
17065  PyObject *__pyx_v_item = NULL;
17066  Py_ssize_t __pyx_v_nslices;
17067  PyObject *__pyx_r = NULL;
17068  __Pyx_TraceDeclarations
17069  __Pyx_RefNannyDeclarations
17070  int __pyx_t_1;
17071  int __pyx_t_2;
17072  PyObject *__pyx_t_3 = NULL;
17073  PyObject *__pyx_t_4 = NULL;
17074  Py_ssize_t __pyx_t_5;
17075  PyObject *(*__pyx_t_6)(PyObject *);
17076  PyObject *__pyx_t_7 = NULL;
17077  Py_ssize_t __pyx_t_8;
17078  int __pyx_t_9;
17079  int __pyx_t_10;
17080  PyObject *__pyx_t_11 = NULL;
17081  int __pyx_lineno = 0;
17082  const char *__pyx_filename = NULL;
17083  int __pyx_clineno = 0;
17084  __Pyx_RefNannySetupContext("_unellipsify", 0);
17085  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 668, 0, __PYX_ERR(1, 668, __pyx_L1_error));
17086 
17087  /* "View.MemoryView":673
17088  * full slices.
17089  * """
17090  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
17091  * tup = (index,)
17092  * else:
17093  */
17094  __Pyx_TraceLine(673,0,__PYX_ERR(1, 673, __pyx_L1_error))
17095  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
17096  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
17097  if (__pyx_t_2) {
17098 
17099  /* "View.MemoryView":674
17100  * """
17101  * if not isinstance(index, tuple):
17102  * tup = (index,) # <<<<<<<<<<<<<<
17103  * else:
17104  * tup = index
17105  */
17106  __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
17107  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 674, __pyx_L1_error)
17108  __Pyx_GOTREF(__pyx_t_3);
17109  __Pyx_INCREF(__pyx_v_index);
17110  __Pyx_GIVEREF(__pyx_v_index);
17111  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
17112  __pyx_v_tup = __pyx_t_3;
17113  __pyx_t_3 = 0;
17114 
17115  /* "View.MemoryView":673
17116  * full slices.
17117  * """
17118  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
17119  * tup = (index,)
17120  * else:
17121  */
17122  goto __pyx_L3;
17123  }
17124 
17125  /* "View.MemoryView":676
17126  * tup = (index,)
17127  * else:
17128  * tup = index # <<<<<<<<<<<<<<
17129  *
17130  * result = []
17131  */
17132  __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
17133  /*else*/ {
17134  __Pyx_INCREF(__pyx_v_index);
17135  __pyx_v_tup = __pyx_v_index;
17136  }
17137  __pyx_L3:;
17138 
17139  /* "View.MemoryView":678
17140  * tup = index
17141  *
17142  * result = [] # <<<<<<<<<<<<<<
17143  * have_slices = False
17144  * seen_ellipsis = False
17145  */
17146  __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
17147  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 678, __pyx_L1_error)
17148  __Pyx_GOTREF(__pyx_t_3);
17149  __pyx_v_result = ((PyObject*)__pyx_t_3);
17150  __pyx_t_3 = 0;
17151 
17152  /* "View.MemoryView":679
17153  *
17154  * result = []
17155  * have_slices = False # <<<<<<<<<<<<<<
17156  * seen_ellipsis = False
17157  * for idx, item in enumerate(tup):
17158  */
17159  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
17160  __pyx_v_have_slices = 0;
17161 
17162  /* "View.MemoryView":680
17163  * result = []
17164  * have_slices = False
17165  * seen_ellipsis = False # <<<<<<<<<<<<<<
17166  * for idx, item in enumerate(tup):
17167  * if item is Ellipsis:
17168  */
17169  __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
17170  __pyx_v_seen_ellipsis = 0;
17171 
17172  /* "View.MemoryView":681
17173  * have_slices = False
17174  * seen_ellipsis = False
17175  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
17176  * if item is Ellipsis:
17177  * if not seen_ellipsis:
17178  */
17179  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
17180  __Pyx_INCREF(__pyx_int_0);
17181  __pyx_t_3 = __pyx_int_0;
17182  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
17183  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
17184  __pyx_t_6 = NULL;
17185  } else {
17186  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 681, __pyx_L1_error)
17187  __Pyx_GOTREF(__pyx_t_4);
17188  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 681, __pyx_L1_error)
17189  }
17190  for (;;) {
17191  if (likely(!__pyx_t_6)) {
17192  if (likely(PyList_CheckExact(__pyx_t_4))) {
17193  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
17194  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17195  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
17196  #else
17197  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
17198  __Pyx_GOTREF(__pyx_t_7);
17199  #endif
17200  } else {
17201  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
17202  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17203  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 681, __pyx_L1_error)
17204  #else
17205  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
17206  __Pyx_GOTREF(__pyx_t_7);
17207  #endif
17208  }
17209  } else {
17210  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
17211  if (unlikely(!__pyx_t_7)) {
17212  PyObject* exc_type = PyErr_Occurred();
17213  if (exc_type) {
17214  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17215  else __PYX_ERR(1, 681, __pyx_L1_error)
17216  }
17217  break;
17218  }
17219  __Pyx_GOTREF(__pyx_t_7);
17220  }
17221  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
17222  __pyx_t_7 = 0;
17223  __Pyx_INCREF(__pyx_t_3);
17224  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
17225  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 681, __pyx_L1_error)
17226  __Pyx_GOTREF(__pyx_t_7);
17227  __Pyx_DECREF(__pyx_t_3);
17228  __pyx_t_3 = __pyx_t_7;
17229  __pyx_t_7 = 0;
17230 
17231  /* "View.MemoryView":682
17232  * seen_ellipsis = False
17233  * for idx, item in enumerate(tup):
17234  * if item is Ellipsis: # <<<<<<<<<<<<<<
17235  * if not seen_ellipsis:
17236  * result.extend([slice(None)] * (ndim - len(tup) + 1))
17237  */
17238  __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
17239  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
17240  __pyx_t_1 = (__pyx_t_2 != 0);
17241  if (__pyx_t_1) {
17242 
17243  /* "View.MemoryView":683
17244  * for idx, item in enumerate(tup):
17245  * if item is Ellipsis:
17246  * if not seen_ellipsis: # <<<<<<<<<<<<<<
17247  * result.extend([slice(None)] * (ndim - len(tup) + 1))
17248  * seen_ellipsis = True
17249  */
17250  __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
17251  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
17252  if (__pyx_t_1) {
17253 
17254  /* "View.MemoryView":684
17255  * if item is Ellipsis:
17256  * if not seen_ellipsis:
17257  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
17258  * seen_ellipsis = True
17259  * else:
17260  */
17261  __Pyx_TraceLine(684,0,__PYX_ERR(1, 684, __pyx_L1_error))
17262  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
17263  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __pyx_L1_error)
17264  __Pyx_GOTREF(__pyx_t_7);
17265  { Py_ssize_t __pyx_temp;
17266  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
17267  __Pyx_INCREF(__pyx_slice__4);
17268  __Pyx_GIVEREF(__pyx_slice__4);
17269  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__4);
17270  }
17271  }
17272  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 684, __pyx_L1_error)
17273  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17274 
17275  /* "View.MemoryView":685
17276  * if not seen_ellipsis:
17277  * result.extend([slice(None)] * (ndim - len(tup) + 1))
17278  * seen_ellipsis = True # <<<<<<<<<<<<<<
17279  * else:
17280  * result.append(slice(None))
17281  */
17282  __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
17283  __pyx_v_seen_ellipsis = 1;
17284 
17285  /* "View.MemoryView":683
17286  * for idx, item in enumerate(tup):
17287  * if item is Ellipsis:
17288  * if not seen_ellipsis: # <<<<<<<<<<<<<<
17289  * result.extend([slice(None)] * (ndim - len(tup) + 1))
17290  * seen_ellipsis = True
17291  */
17292  goto __pyx_L7;
17293  }
17294 
17295  /* "View.MemoryView":687
17296  * seen_ellipsis = True
17297  * else:
17298  * result.append(slice(None)) # <<<<<<<<<<<<<<
17299  * have_slices = True
17300  * else:
17301  */
17302  __Pyx_TraceLine(687,0,__PYX_ERR(1, 687, __pyx_L1_error))
17303  /*else*/ {
17304  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 687, __pyx_L1_error)
17305  }
17306  __pyx_L7:;
17307 
17308  /* "View.MemoryView":688
17309  * else:
17310  * result.append(slice(None))
17311  * have_slices = True # <<<<<<<<<<<<<<
17312  * else:
17313  * if not isinstance(item, slice) and not PyIndex_Check(item):
17314  */
17315  __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
17316  __pyx_v_have_slices = 1;
17317 
17318  /* "View.MemoryView":682
17319  * seen_ellipsis = False
17320  * for idx, item in enumerate(tup):
17321  * if item is Ellipsis: # <<<<<<<<<<<<<<
17322  * if not seen_ellipsis:
17323  * result.extend([slice(None)] * (ndim - len(tup) + 1))
17324  */
17325  goto __pyx_L6;
17326  }
17327 
17328  /* "View.MemoryView":690
17329  * have_slices = True
17330  * else:
17331  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
17332  * raise TypeError("Cannot index with type '%s'" % type(item))
17333  *
17334  */
17335  __Pyx_TraceLine(690,0,__PYX_ERR(1, 690, __pyx_L1_error))
17336  /*else*/ {
17337  __pyx_t_2 = PySlice_Check(__pyx_v_item);
17338  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
17339  if (__pyx_t_10) {
17340  } else {
17341  __pyx_t_1 = __pyx_t_10;
17342  goto __pyx_L9_bool_binop_done;
17343  }
17344  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
17345  __pyx_t_1 = __pyx_t_10;
17346  __pyx_L9_bool_binop_done:;
17347  if (unlikely(__pyx_t_1)) {
17348 
17349  /* "View.MemoryView":691
17350  * else:
17351  * if not isinstance(item, slice) and not PyIndex_Check(item):
17352  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
17353  *
17354  * have_slices = have_slices or isinstance(item, slice)
17355  */
17356  __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
17357  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 691, __pyx_L1_error)
17358  __Pyx_GOTREF(__pyx_t_7);
17359  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 691, __pyx_L1_error)
17360  __Pyx_GOTREF(__pyx_t_11);
17361  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17362  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
17363  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
17364  __PYX_ERR(1, 691, __pyx_L1_error)
17365 
17366  /* "View.MemoryView":690
17367  * have_slices = True
17368  * else:
17369  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
17370  * raise TypeError("Cannot index with type '%s'" % type(item))
17371  *
17372  */
17373  }
17374 
17375  /* "View.MemoryView":693
17376  * raise TypeError("Cannot index with type '%s'" % type(item))
17377  *
17378  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
17379  * result.append(item)
17380  *
17381  */
17382  __Pyx_TraceLine(693,0,__PYX_ERR(1, 693, __pyx_L1_error))
17383  __pyx_t_10 = (__pyx_v_have_slices != 0);
17384  if (!__pyx_t_10) {
17385  } else {
17386  __pyx_t_1 = __pyx_t_10;
17387  goto __pyx_L11_bool_binop_done;
17388  }
17389  __pyx_t_10 = PySlice_Check(__pyx_v_item);
17390  __pyx_t_2 = (__pyx_t_10 != 0);
17391  __pyx_t_1 = __pyx_t_2;
17392  __pyx_L11_bool_binop_done:;
17393  __pyx_v_have_slices = __pyx_t_1;
17394 
17395  /* "View.MemoryView":694
17396  *
17397  * have_slices = have_slices or isinstance(item, slice)
17398  * result.append(item) # <<<<<<<<<<<<<<
17399  *
17400  * nslices = ndim - len(result)
17401  */
17402  __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
17403  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
17404  }
17405  __pyx_L6:;
17406 
17407  /* "View.MemoryView":681
17408  * have_slices = False
17409  * seen_ellipsis = False
17410  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
17411  * if item is Ellipsis:
17412  * if not seen_ellipsis:
17413  */
17414  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
17415  }
17416  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17417  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17418 
17419  /* "View.MemoryView":696
17420  * result.append(item)
17421  *
17422  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
17423  * if nslices:
17424  * result.extend([slice(None)] * nslices)
17425  */
17426  __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
17427  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
17428  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
17429 
17430  /* "View.MemoryView":697
17431  *
17432  * nslices = ndim - len(result)
17433  * if nslices: # <<<<<<<<<<<<<<
17434  * result.extend([slice(None)] * nslices)
17435  *
17436  */
17437  __Pyx_TraceLine(697,0,__PYX_ERR(1, 697, __pyx_L1_error))
17438  __pyx_t_1 = (__pyx_v_nslices != 0);
17439  if (__pyx_t_1) {
17440 
17441  /* "View.MemoryView":698
17442  * nslices = ndim - len(result)
17443  * if nslices:
17444  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
17445  *
17446  * return have_slices or nslices, tuple(result)
17447  */
17448  __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
17449  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
17450  __Pyx_GOTREF(__pyx_t_3);
17451  { Py_ssize_t __pyx_temp;
17452  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
17453  __Pyx_INCREF(__pyx_slice__4);
17454  __Pyx_GIVEREF(__pyx_slice__4);
17455  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__4);
17456  }
17457  }
17458  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 698, __pyx_L1_error)
17459  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17460 
17461  /* "View.MemoryView":697
17462  *
17463  * nslices = ndim - len(result)
17464  * if nslices: # <<<<<<<<<<<<<<
17465  * result.extend([slice(None)] * nslices)
17466  *
17467  */
17468  }
17469 
17470  /* "View.MemoryView":700
17471  * result.extend([slice(None)] * nslices)
17472  *
17473  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
17474  *
17475  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
17476  */
17477  __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
17478  __Pyx_XDECREF(__pyx_r);
17479  if (!__pyx_v_have_slices) {
17480  } else {
17481  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
17482  __Pyx_GOTREF(__pyx_t_4);
17483  __pyx_t_3 = __pyx_t_4;
17484  __pyx_t_4 = 0;
17485  goto __pyx_L14_bool_binop_done;
17486  }
17487  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
17488  __Pyx_GOTREF(__pyx_t_4);
17489  __pyx_t_3 = __pyx_t_4;
17490  __pyx_t_4 = 0;
17491  __pyx_L14_bool_binop_done:;
17492  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 700, __pyx_L1_error)
17493  __Pyx_GOTREF(__pyx_t_4);
17494  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 700, __pyx_L1_error)
17495  __Pyx_GOTREF(__pyx_t_11);
17496  __Pyx_GIVEREF(__pyx_t_3);
17497  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
17498  __Pyx_GIVEREF(__pyx_t_4);
17499  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
17500  __pyx_t_3 = 0;
17501  __pyx_t_4 = 0;
17502  __pyx_r = ((PyObject*)__pyx_t_11);
17503  __pyx_t_11 = 0;
17504  goto __pyx_L0;
17505 
17506  /* "View.MemoryView":668
17507  * return isinstance(o, memoryview)
17508  *
17509  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
17510  * """
17511  * Replace all ellipses with full slices and fill incomplete indices with
17512  */
17513 
17514  /* function exit code */
17515  __pyx_L1_error:;
17516  __Pyx_XDECREF(__pyx_t_3);
17517  __Pyx_XDECREF(__pyx_t_4);
17518  __Pyx_XDECREF(__pyx_t_7);
17519  __Pyx_XDECREF(__pyx_t_11);
17520  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
17521  __pyx_r = 0;
17522  __pyx_L0:;
17523  __Pyx_XDECREF(__pyx_v_tup);
17524  __Pyx_XDECREF(__pyx_v_result);
17525  __Pyx_XDECREF(__pyx_v_idx);
17526  __Pyx_XDECREF(__pyx_v_item);
17527  __Pyx_XGIVEREF(__pyx_r);
17528  __Pyx_TraceReturn(__pyx_r, 0);
17529  __Pyx_RefNannyFinishContext();
17530  return __pyx_r;
17531 }
17532 
17533 /* "View.MemoryView":702
17534  * return have_slices or nslices, tuple(result)
17535  *
17536  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
17537  * for suboffset in suboffsets[:ndim]:
17538  * if suboffset >= 0:
17539  */
17540 
17541 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
17542  Py_ssize_t __pyx_v_suboffset;
17543  PyObject *__pyx_r = NULL;
17544  __Pyx_TraceDeclarations
17545  __Pyx_RefNannyDeclarations
17546  Py_ssize_t *__pyx_t_1;
17547  Py_ssize_t *__pyx_t_2;
17548  Py_ssize_t *__pyx_t_3;
17549  int __pyx_t_4;
17550  PyObject *__pyx_t_5 = NULL;
17551  int __pyx_lineno = 0;
17552  const char *__pyx_filename = NULL;
17553  int __pyx_clineno = 0;
17554  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
17555  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 702, 0, __PYX_ERR(1, 702, __pyx_L1_error));
17556 
17557  /* "View.MemoryView":703
17558  *
17559  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
17560  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
17561  * if suboffset >= 0:
17562  * raise ValueError("Indirect dimensions not supported")
17563  */
17564  __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
17565  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
17566  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
17567  __pyx_t_1 = __pyx_t_3;
17568  __pyx_v_suboffset = (__pyx_t_1[0]);
17569 
17570  /* "View.MemoryView":704
17571  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
17572  * for suboffset in suboffsets[:ndim]:
17573  * if suboffset >= 0: # <<<<<<<<<<<<<<
17574  * raise ValueError("Indirect dimensions not supported")
17575  *
17576  */
17577  __Pyx_TraceLine(704,0,__PYX_ERR(1, 704, __pyx_L1_error))
17578  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
17579  if (unlikely(__pyx_t_4)) {
17580 
17581  /* "View.MemoryView":705
17582  * for suboffset in suboffsets[:ndim]:
17583  * if suboffset >= 0:
17584  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
17585  *
17586  *
17587  */
17588  __Pyx_TraceLine(705,0,__PYX_ERR(1, 705, __pyx_L1_error))
17589  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
17590  __Pyx_GOTREF(__pyx_t_5);
17591  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
17592  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17593  __PYX_ERR(1, 705, __pyx_L1_error)
17594 
17595  /* "View.MemoryView":704
17596  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
17597  * for suboffset in suboffsets[:ndim]:
17598  * if suboffset >= 0: # <<<<<<<<<<<<<<
17599  * raise ValueError("Indirect dimensions not supported")
17600  *
17601  */
17602  }
17603  }
17604 
17605  /* "View.MemoryView":702
17606  * return have_slices or nslices, tuple(result)
17607  *
17608  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
17609  * for suboffset in suboffsets[:ndim]:
17610  * if suboffset >= 0:
17611  */
17612 
17613  /* function exit code */
17614  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17615  goto __pyx_L0;
17616  __pyx_L1_error:;
17617  __Pyx_XDECREF(__pyx_t_5);
17618  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
17619  __pyx_r = 0;
17620  __pyx_L0:;
17621  __Pyx_XGIVEREF(__pyx_r);
17622  __Pyx_TraceReturn(__pyx_r, 0);
17623  __Pyx_RefNannyFinishContext();
17624  return __pyx_r;
17625 }
17626 
17627 /* "View.MemoryView":712
17628  *
17629  * @cname('__pyx_memview_slice')
17630  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
17631  * cdef int new_ndim = 0, suboffset_dim = -1, dim
17632  * cdef bint negative_step
17633  */
17634 
17635 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
17636  int __pyx_v_new_ndim;
17637  int __pyx_v_suboffset_dim;
17638  int __pyx_v_dim;
17639  __Pyx_memviewslice __pyx_v_src;
17640  __Pyx_memviewslice __pyx_v_dst;
17641  __Pyx_memviewslice *__pyx_v_p_src;
17642  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
17643  __Pyx_memviewslice *__pyx_v_p_dst;
17644  int *__pyx_v_p_suboffset_dim;
17645  Py_ssize_t __pyx_v_start;
17646  Py_ssize_t __pyx_v_stop;
17647  Py_ssize_t __pyx_v_step;
17648  int __pyx_v_have_start;
17649  int __pyx_v_have_stop;
17650  int __pyx_v_have_step;
17651  PyObject *__pyx_v_index = NULL;
17652  struct __pyx_memoryview_obj *__pyx_r = NULL;
17653  __Pyx_TraceDeclarations
17654  __Pyx_RefNannyDeclarations
17655  int __pyx_t_1;
17656  int __pyx_t_2;
17657  PyObject *__pyx_t_3 = NULL;
17658  struct __pyx_memoryview_obj *__pyx_t_4;
17659  char *__pyx_t_5;
17660  int __pyx_t_6;
17661  Py_ssize_t __pyx_t_7;
17662  PyObject *(*__pyx_t_8)(PyObject *);
17663  PyObject *__pyx_t_9 = NULL;
17664  Py_ssize_t __pyx_t_10;
17665  int __pyx_t_11;
17666  Py_ssize_t __pyx_t_12;
17667  int __pyx_lineno = 0;
17668  const char *__pyx_filename = NULL;
17669  int __pyx_clineno = 0;
17670  __Pyx_RefNannySetupContext("memview_slice", 0);
17671  __Pyx_TraceCall("memview_slice", __pyx_f[1], 712, 0, __PYX_ERR(1, 712, __pyx_L1_error));
17672 
17673  /* "View.MemoryView":713
17674  * @cname('__pyx_memview_slice')
17675  * cdef memoryview memview_slice(memoryview memview, object indices):
17676  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
17677  * cdef bint negative_step
17678  * cdef __Pyx_memviewslice src, dst
17679  */
17680  __Pyx_TraceLine(713,0,__PYX_ERR(1, 713, __pyx_L1_error))
17681  __pyx_v_new_ndim = 0;
17682  __pyx_v_suboffset_dim = -1;
17683 
17684  /* "View.MemoryView":720
17685  *
17686  *
17687  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
17688  *
17689  * cdef _memoryviewslice memviewsliceobj
17690  */
17691  __Pyx_TraceLine(720,0,__PYX_ERR(1, 720, __pyx_L1_error))
17692  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
17693 
17694  /* "View.MemoryView":724
17695  * cdef _memoryviewslice memviewsliceobj
17696  *
17697  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
17698  *
17699  * if isinstance(memview, _memoryviewslice):
17700  */
17701  __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
17702  #ifndef CYTHON_WITHOUT_ASSERTIONS
17703  if (unlikely(__pyx_assertions_enabled())) {
17704  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
17705  PyErr_SetNone(PyExc_AssertionError);
17706  __PYX_ERR(1, 724, __pyx_L1_error)
17707  }
17708  }
17709  #endif
17710 
17711  /* "View.MemoryView":726
17712  * assert memview.view.ndim > 0
17713  *
17714  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17715  * memviewsliceobj = memview
17716  * p_src = &memviewsliceobj.from_slice
17717  */
17718  __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
17719  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17720  __pyx_t_2 = (__pyx_t_1 != 0);
17721  if (__pyx_t_2) {
17722 
17723  /* "View.MemoryView":727
17724  *
17725  * if isinstance(memview, _memoryviewslice):
17726  * memviewsliceobj = memview # <<<<<<<<<<<<<<
17727  * p_src = &memviewsliceobj.from_slice
17728  * else:
17729  */
17730  __Pyx_TraceLine(727,0,__PYX_ERR(1, 727, __pyx_L1_error))
17731  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 727, __pyx_L1_error)
17732  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17733  __Pyx_INCREF(__pyx_t_3);
17734  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17735  __pyx_t_3 = 0;
17736 
17737  /* "View.MemoryView":728
17738  * if isinstance(memview, _memoryviewslice):
17739  * memviewsliceobj = memview
17740  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
17741  * else:
17742  * slice_copy(memview, &src)
17743  */
17744  __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
17745  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
17746 
17747  /* "View.MemoryView":726
17748  * assert memview.view.ndim > 0
17749  *
17750  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17751  * memviewsliceobj = memview
17752  * p_src = &memviewsliceobj.from_slice
17753  */
17754  goto __pyx_L3;
17755  }
17756 
17757  /* "View.MemoryView":730
17758  * p_src = &memviewsliceobj.from_slice
17759  * else:
17760  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
17761  * p_src = &src
17762  *
17763  */
17764  __Pyx_TraceLine(730,0,__PYX_ERR(1, 730, __pyx_L1_error))
17765  /*else*/ {
17766  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
17767 
17768  /* "View.MemoryView":731
17769  * else:
17770  * slice_copy(memview, &src)
17771  * p_src = &src # <<<<<<<<<<<<<<
17772  *
17773  *
17774  */
17775  __Pyx_TraceLine(731,0,__PYX_ERR(1, 731, __pyx_L1_error))
17776  __pyx_v_p_src = (&__pyx_v_src);
17777  }
17778  __pyx_L3:;
17779 
17780  /* "View.MemoryView":737
17781  *
17782  *
17783  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
17784  * dst.data = p_src.data
17785  *
17786  */
17787  __Pyx_TraceLine(737,0,__PYX_ERR(1, 737, __pyx_L1_error))
17788  __pyx_t_4 = __pyx_v_p_src->memview;
17789  __pyx_v_dst.memview = __pyx_t_4;
17790 
17791  /* "View.MemoryView":738
17792  *
17793  * dst.memview = p_src.memview
17794  * dst.data = p_src.data # <<<<<<<<<<<<<<
17795  *
17796  *
17797  */
17798  __Pyx_TraceLine(738,0,__PYX_ERR(1, 738, __pyx_L1_error))
17799  __pyx_t_5 = __pyx_v_p_src->data;
17800  __pyx_v_dst.data = __pyx_t_5;
17801 
17802  /* "View.MemoryView":743
17803  *
17804  *
17805  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
17806  * cdef int *p_suboffset_dim = &suboffset_dim
17807  * cdef Py_ssize_t start, stop, step
17808  */
17809  __Pyx_TraceLine(743,0,__PYX_ERR(1, 743, __pyx_L1_error))
17810  __pyx_v_p_dst = (&__pyx_v_dst);
17811 
17812  /* "View.MemoryView":744
17813  *
17814  * cdef __Pyx_memviewslice *p_dst = &dst
17815  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
17816  * cdef Py_ssize_t start, stop, step
17817  * cdef bint have_start, have_stop, have_step
17818  */
17819  __Pyx_TraceLine(744,0,__PYX_ERR(1, 744, __pyx_L1_error))
17820  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
17821 
17822  /* "View.MemoryView":748
17823  * cdef bint have_start, have_stop, have_step
17824  *
17825  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
17826  * if PyIndex_Check(index):
17827  * slice_memviewslice(
17828  */
17829  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
17830  __pyx_t_6 = 0;
17831  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
17832  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
17833  __pyx_t_8 = NULL;
17834  } else {
17835  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
17836  __Pyx_GOTREF(__pyx_t_3);
17837  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 748, __pyx_L1_error)
17838  }
17839  for (;;) {
17840  if (likely(!__pyx_t_8)) {
17841  if (likely(PyList_CheckExact(__pyx_t_3))) {
17842  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
17843  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17844  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
17845  #else
17846  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
17847  __Pyx_GOTREF(__pyx_t_9);
17848  #endif
17849  } else {
17850  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
17851  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17852  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 748, __pyx_L1_error)
17853  #else
17854  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __pyx_L1_error)
17855  __Pyx_GOTREF(__pyx_t_9);
17856  #endif
17857  }
17858  } else {
17859  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
17860  if (unlikely(!__pyx_t_9)) {
17861  PyObject* exc_type = PyErr_Occurred();
17862  if (exc_type) {
17863  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17864  else __PYX_ERR(1, 748, __pyx_L1_error)
17865  }
17866  break;
17867  }
17868  __Pyx_GOTREF(__pyx_t_9);
17869  }
17870  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
17871  __pyx_t_9 = 0;
17872  __pyx_v_dim = __pyx_t_6;
17873  __pyx_t_6 = (__pyx_t_6 + 1);
17874 
17875  /* "View.MemoryView":749
17876  *
17877  * for dim, index in enumerate(indices):
17878  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
17879  * slice_memviewslice(
17880  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
17881  */
17882  __Pyx_TraceLine(749,0,__PYX_ERR(1, 749, __pyx_L1_error))
17883  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
17884  if (__pyx_t_2) {
17885 
17886  /* "View.MemoryView":753
17887  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
17888  * dim, new_ndim, p_suboffset_dim,
17889  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
17890  * 0, 0, 0, # have_{start,stop,step}
17891  * False)
17892  */
17893  __Pyx_TraceLine(753,0,__PYX_ERR(1, 753, __pyx_L1_error))
17894  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 753, __pyx_L1_error)
17895 
17896  /* "View.MemoryView":750
17897  * for dim, index in enumerate(indices):
17898  * if PyIndex_Check(index):
17899  * slice_memviewslice( # <<<<<<<<<<<<<<
17900  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
17901  * dim, new_ndim, p_suboffset_dim,
17902  */
17903  __Pyx_TraceLine(750,0,__PYX_ERR(1, 750, __pyx_L1_error))
17904  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
17905 
17906  /* "View.MemoryView":749
17907  *
17908  * for dim, index in enumerate(indices):
17909  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
17910  * slice_memviewslice(
17911  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
17912  */
17913  goto __pyx_L6;
17914  }
17915 
17916  /* "View.MemoryView":756
17917  * 0, 0, 0, # have_{start,stop,step}
17918  * False)
17919  * elif index is None: # <<<<<<<<<<<<<<
17920  * p_dst.shape[new_ndim] = 1
17921  * p_dst.strides[new_ndim] = 0
17922  */
17923  __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
17924  __pyx_t_2 = (__pyx_v_index == Py_None);
17925  __pyx_t_1 = (__pyx_t_2 != 0);
17926  if (__pyx_t_1) {
17927 
17928  /* "View.MemoryView":757
17929  * False)
17930  * elif index is None:
17931  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
17932  * p_dst.strides[new_ndim] = 0
17933  * p_dst.suboffsets[new_ndim] = -1
17934  */
17935  __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
17936  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
17937 
17938  /* "View.MemoryView":758
17939  * elif index is None:
17940  * p_dst.shape[new_ndim] = 1
17941  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
17942  * p_dst.suboffsets[new_ndim] = -1
17943  * new_ndim += 1
17944  */
17945  __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
17946  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
17947 
17948  /* "View.MemoryView":759
17949  * p_dst.shape[new_ndim] = 1
17950  * p_dst.strides[new_ndim] = 0
17951  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
17952  * new_ndim += 1
17953  * else:
17954  */
17955  __Pyx_TraceLine(759,0,__PYX_ERR(1, 759, __pyx_L1_error))
17956  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
17957 
17958  /* "View.MemoryView":760
17959  * p_dst.strides[new_ndim] = 0
17960  * p_dst.suboffsets[new_ndim] = -1
17961  * new_ndim += 1 # <<<<<<<<<<<<<<
17962  * else:
17963  * start = index.start or 0
17964  */
17965  __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
17966  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
17967 
17968  /* "View.MemoryView":756
17969  * 0, 0, 0, # have_{start,stop,step}
17970  * False)
17971  * elif index is None: # <<<<<<<<<<<<<<
17972  * p_dst.shape[new_ndim] = 1
17973  * p_dst.strides[new_ndim] = 0
17974  */
17975  goto __pyx_L6;
17976  }
17977 
17978  /* "View.MemoryView":762
17979  * new_ndim += 1
17980  * else:
17981  * start = index.start or 0 # <<<<<<<<<<<<<<
17982  * stop = index.stop or 0
17983  * step = index.step or 0
17984  */
17985  __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
17986  /*else*/ {
17987  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
17988  __Pyx_GOTREF(__pyx_t_9);
17989  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
17990  if (!__pyx_t_1) {
17991  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17992  } else {
17993  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
17994  __pyx_t_10 = __pyx_t_12;
17995  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
17996  goto __pyx_L7_bool_binop_done;
17997  }
17998  __pyx_t_10 = 0;
17999  __pyx_L7_bool_binop_done:;
18000  __pyx_v_start = __pyx_t_10;
18001 
18002  /* "View.MemoryView":763
18003  * else:
18004  * start = index.start or 0
18005  * stop = index.stop or 0 # <<<<<<<<<<<<<<
18006  * step = index.step or 0
18007  *
18008  */
18009  __Pyx_TraceLine(763,0,__PYX_ERR(1, 763, __pyx_L1_error))
18010  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 763, __pyx_L1_error)
18011  __Pyx_GOTREF(__pyx_t_9);
18012  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 763, __pyx_L1_error)
18013  if (!__pyx_t_1) {
18014  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18015  } else {
18016  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
18017  __pyx_t_10 = __pyx_t_12;
18018  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18019  goto __pyx_L9_bool_binop_done;
18020  }
18021  __pyx_t_10 = 0;
18022  __pyx_L9_bool_binop_done:;
18023  __pyx_v_stop = __pyx_t_10;
18024 
18025  /* "View.MemoryView":764
18026  * start = index.start or 0
18027  * stop = index.stop or 0
18028  * step = index.step or 0 # <<<<<<<<<<<<<<
18029  *
18030  * have_start = index.start is not None
18031  */
18032  __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
18033  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
18034  __Pyx_GOTREF(__pyx_t_9);
18035  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 764, __pyx_L1_error)
18036  if (!__pyx_t_1) {
18037  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18038  } else {
18039  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
18040  __pyx_t_10 = __pyx_t_12;
18041  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18042  goto __pyx_L11_bool_binop_done;
18043  }
18044  __pyx_t_10 = 0;
18045  __pyx_L11_bool_binop_done:;
18046  __pyx_v_step = __pyx_t_10;
18047 
18048  /* "View.MemoryView":766
18049  * step = index.step or 0
18050  *
18051  * have_start = index.start is not None # <<<<<<<<<<<<<<
18052  * have_stop = index.stop is not None
18053  * have_step = index.step is not None
18054  */
18055  __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
18056  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
18057  __Pyx_GOTREF(__pyx_t_9);
18058  __pyx_t_1 = (__pyx_t_9 != Py_None);
18059  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18060  __pyx_v_have_start = __pyx_t_1;
18061 
18062  /* "View.MemoryView":767
18063  *
18064  * have_start = index.start is not None
18065  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
18066  * have_step = index.step is not None
18067  *
18068  */
18069  __Pyx_TraceLine(767,0,__PYX_ERR(1, 767, __pyx_L1_error))
18070  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 767, __pyx_L1_error)
18071  __Pyx_GOTREF(__pyx_t_9);
18072  __pyx_t_1 = (__pyx_t_9 != Py_None);
18073  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18074  __pyx_v_have_stop = __pyx_t_1;
18075 
18076  /* "View.MemoryView":768
18077  * have_start = index.start is not None
18078  * have_stop = index.stop is not None
18079  * have_step = index.step is not None # <<<<<<<<<<<<<<
18080  *
18081  * slice_memviewslice(
18082  */
18083  __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
18084  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 768, __pyx_L1_error)
18085  __Pyx_GOTREF(__pyx_t_9);
18086  __pyx_t_1 = (__pyx_t_9 != Py_None);
18087  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18088  __pyx_v_have_step = __pyx_t_1;
18089 
18090  /* "View.MemoryView":770
18091  * have_step = index.step is not None
18092  *
18093  * slice_memviewslice( # <<<<<<<<<<<<<<
18094  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
18095  * dim, new_ndim, p_suboffset_dim,
18096  */
18097  __Pyx_TraceLine(770,0,__PYX_ERR(1, 770, __pyx_L1_error))
18098  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
18099 
18100  /* "View.MemoryView":776
18101  * have_start, have_stop, have_step,
18102  * True)
18103  * new_ndim += 1 # <<<<<<<<<<<<<<
18104  *
18105  * if isinstance(memview, _memoryviewslice):
18106  */
18107  __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
18108  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
18109  }
18110  __pyx_L6:;
18111 
18112  /* "View.MemoryView":748
18113  * cdef bint have_start, have_stop, have_step
18114  *
18115  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
18116  * if PyIndex_Check(index):
18117  * slice_memviewslice(
18118  */
18119  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
18120  }
18121  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18122 
18123  /* "View.MemoryView":778
18124  * new_ndim += 1
18125  *
18126  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18127  * return memoryview_fromslice(dst, new_ndim,
18128  * memviewsliceobj.to_object_func,
18129  */
18130  __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
18131  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
18132  __pyx_t_2 = (__pyx_t_1 != 0);
18133  if (__pyx_t_2) {
18134 
18135  /* "View.MemoryView":779
18136  *
18137  * if isinstance(memview, _memoryviewslice):
18138  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
18139  * memviewsliceobj.to_object_func,
18140  * memviewsliceobj.to_dtype_func,
18141  */
18142  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
18143  __Pyx_XDECREF(((PyObject *)__pyx_r));
18144 
18145  /* "View.MemoryView":780
18146  * if isinstance(memview, _memoryviewslice):
18147  * return memoryview_fromslice(dst, new_ndim,
18148  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
18149  * memviewsliceobj.to_dtype_func,
18150  * memview.dtype_is_object)
18151  */
18152  __Pyx_TraceLine(780,0,__PYX_ERR(1, 780, __pyx_L1_error))
18153  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
18154 
18155  /* "View.MemoryView":781
18156  * return memoryview_fromslice(dst, new_ndim,
18157  * memviewsliceobj.to_object_func,
18158  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
18159  * memview.dtype_is_object)
18160  * else:
18161  */
18162  __Pyx_TraceLine(781,0,__PYX_ERR(1, 781, __pyx_L1_error))
18163  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
18164 
18165  /* "View.MemoryView":779
18166  *
18167  * if isinstance(memview, _memoryviewslice):
18168  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
18169  * memviewsliceobj.to_object_func,
18170  * memviewsliceobj.to_dtype_func,
18171  */
18172  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
18173  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 779, __pyx_L1_error)
18174  __Pyx_GOTREF(__pyx_t_3);
18175  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
18176  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
18177  __pyx_t_3 = 0;
18178  goto __pyx_L0;
18179 
18180  /* "View.MemoryView":778
18181  * new_ndim += 1
18182  *
18183  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
18184  * return memoryview_fromslice(dst, new_ndim,
18185  * memviewsliceobj.to_object_func,
18186  */
18187  }
18188 
18189  /* "View.MemoryView":784
18190  * memview.dtype_is_object)
18191  * else:
18192  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
18193  * memview.dtype_is_object)
18194  *
18195  */
18196  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
18197  /*else*/ {
18198  __Pyx_XDECREF(((PyObject *)__pyx_r));
18199 
18200  /* "View.MemoryView":785
18201  * else:
18202  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
18203  * memview.dtype_is_object) # <<<<<<<<<<<<<<
18204  *
18205  *
18206  */
18207  __Pyx_TraceLine(785,0,__PYX_ERR(1, 785, __pyx_L1_error))
18208  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 784, __pyx_L1_error)
18209  __Pyx_GOTREF(__pyx_t_3);
18210 
18211  /* "View.MemoryView":784
18212  * memview.dtype_is_object)
18213  * else:
18214  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
18215  * memview.dtype_is_object)
18216  *
18217  */
18218  __Pyx_TraceLine(784,0,__PYX_ERR(1, 784, __pyx_L1_error))
18219  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
18220  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
18221  __pyx_t_3 = 0;
18222  goto __pyx_L0;
18223  }
18224 
18225  /* "View.MemoryView":712
18226  *
18227  * @cname('__pyx_memview_slice')
18228  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
18229  * cdef int new_ndim = 0, suboffset_dim = -1, dim
18230  * cdef bint negative_step
18231  */
18232 
18233  /* function exit code */
18234  __pyx_L1_error:;
18235  __Pyx_XDECREF(__pyx_t_3);
18236  __Pyx_XDECREF(__pyx_t_9);
18237  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
18238  __pyx_r = 0;
18239  __pyx_L0:;
18240  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
18241  __Pyx_XDECREF(__pyx_v_index);
18242  __Pyx_XGIVEREF((PyObject *)__pyx_r);
18243  __Pyx_TraceReturn(__pyx_r, 0);
18244  __Pyx_RefNannyFinishContext();
18245  return __pyx_r;
18246 }
18247 
18248 /* "View.MemoryView":809
18249  *
18250  * @cname('__pyx_memoryview_slice_memviewslice')
18251  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
18252  * __Pyx_memviewslice *dst,
18253  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
18254  */
18255 
18256 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
18257  Py_ssize_t __pyx_v_new_shape;
18258  int __pyx_v_negative_step;
18259  int __pyx_r;
18260  __Pyx_TraceDeclarations
18261  int __pyx_t_1;
18262  int __pyx_t_2;
18263  int __pyx_t_3;
18264  int __pyx_lineno = 0;
18265  const char *__pyx_filename = NULL;
18266  int __pyx_clineno = 0;
18267  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 809, 1, __PYX_ERR(1, 809, __pyx_L1_error));
18268 
18269  /* "View.MemoryView":829
18270  * cdef bint negative_step
18271  *
18272  * if not is_slice: # <<<<<<<<<<<<<<
18273  *
18274  * if start < 0:
18275  */
18276  __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
18277  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
18278  if (__pyx_t_1) {
18279 
18280  /* "View.MemoryView":831
18281  * if not is_slice:
18282  *
18283  * if start < 0: # <<<<<<<<<<<<<<
18284  * start += shape
18285  * if not 0 <= start < shape:
18286  */
18287  __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
18288  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
18289  if (__pyx_t_1) {
18290 
18291  /* "View.MemoryView":832
18292  *
18293  * if start < 0:
18294  * start += shape # <<<<<<<<<<<<<<
18295  * if not 0 <= start < shape:
18296  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
18297  */
18298  __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
18299  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
18300 
18301  /* "View.MemoryView":831
18302  * if not is_slice:
18303  *
18304  * if start < 0: # <<<<<<<<<<<<<<
18305  * start += shape
18306  * if not 0 <= start < shape:
18307  */
18308  }
18309 
18310  /* "View.MemoryView":833
18311  * if start < 0:
18312  * start += shape
18313  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
18314  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
18315  * else:
18316  */
18317  __Pyx_TraceLine(833,1,__PYX_ERR(1, 833, __pyx_L1_error))
18318  __pyx_t_1 = (0 <= __pyx_v_start);
18319  if (__pyx_t_1) {
18320  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
18321  }
18322  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
18323  if (__pyx_t_2) {
18324 
18325  /* "View.MemoryView":834
18326  * start += shape
18327  * if not 0 <= start < shape:
18328  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
18329  * else:
18330  *
18331  */
18332  __Pyx_TraceLine(834,1,__PYX_ERR(1, 834, __pyx_L1_error))
18333  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 834, __pyx_L1_error)
18334 
18335  /* "View.MemoryView":833
18336  * if start < 0:
18337  * start += shape
18338  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
18339  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
18340  * else:
18341  */
18342  }
18343 
18344  /* "View.MemoryView":829
18345  * cdef bint negative_step
18346  *
18347  * if not is_slice: # <<<<<<<<<<<<<<
18348  *
18349  * if start < 0:
18350  */
18351  goto __pyx_L3;
18352  }
18353 
18354  /* "View.MemoryView":837
18355  * else:
18356  *
18357  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
18358  *
18359  * if have_step and step == 0:
18360  */
18361  __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
18362  /*else*/ {
18363  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
18364  if (__pyx_t_1) {
18365  } else {
18366  __pyx_t_2 = __pyx_t_1;
18367  goto __pyx_L6_bool_binop_done;
18368  }
18369  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
18370  __pyx_t_2 = __pyx_t_1;
18371  __pyx_L6_bool_binop_done:;
18372  __pyx_v_negative_step = __pyx_t_2;
18373 
18374  /* "View.MemoryView":839
18375  * negative_step = have_step != 0 and step < 0
18376  *
18377  * if have_step and step == 0: # <<<<<<<<<<<<<<
18378  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
18379  *
18380  */
18381  __Pyx_TraceLine(839,1,__PYX_ERR(1, 839, __pyx_L1_error))
18382  __pyx_t_1 = (__pyx_v_have_step != 0);
18383  if (__pyx_t_1) {
18384  } else {
18385  __pyx_t_2 = __pyx_t_1;
18386  goto __pyx_L9_bool_binop_done;
18387  }
18388  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
18389  __pyx_t_2 = __pyx_t_1;
18390  __pyx_L9_bool_binop_done:;
18391  if (__pyx_t_2) {
18392 
18393  /* "View.MemoryView":840
18394  *
18395  * if have_step and step == 0:
18396  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
18397  *
18398  *
18399  */
18400  __Pyx_TraceLine(840,1,__PYX_ERR(1, 840, __pyx_L1_error))
18401  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 840, __pyx_L1_error)
18402 
18403  /* "View.MemoryView":839
18404  * negative_step = have_step != 0 and step < 0
18405  *
18406  * if have_step and step == 0: # <<<<<<<<<<<<<<
18407  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
18408  *
18409  */
18410  }
18411 
18412  /* "View.MemoryView":843
18413  *
18414  *
18415  * if have_start: # <<<<<<<<<<<<<<
18416  * if start < 0:
18417  * start += shape
18418  */
18419  __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
18420  __pyx_t_2 = (__pyx_v_have_start != 0);
18421  if (__pyx_t_2) {
18422 
18423  /* "View.MemoryView":844
18424  *
18425  * if have_start:
18426  * if start < 0: # <<<<<<<<<<<<<<
18427  * start += shape
18428  * if start < 0:
18429  */
18430  __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
18431  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
18432  if (__pyx_t_2) {
18433 
18434  /* "View.MemoryView":845
18435  * if have_start:
18436  * if start < 0:
18437  * start += shape # <<<<<<<<<<<<<<
18438  * if start < 0:
18439  * start = 0
18440  */
18441  __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
18442  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
18443 
18444  /* "View.MemoryView":846
18445  * if start < 0:
18446  * start += shape
18447  * if start < 0: # <<<<<<<<<<<<<<
18448  * start = 0
18449  * elif start >= shape:
18450  */
18451  __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
18452  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
18453  if (__pyx_t_2) {
18454 
18455  /* "View.MemoryView":847
18456  * start += shape
18457  * if start < 0:
18458  * start = 0 # <<<<<<<<<<<<<<
18459  * elif start >= shape:
18460  * if negative_step:
18461  */
18462  __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
18463  __pyx_v_start = 0;
18464 
18465  /* "View.MemoryView":846
18466  * if start < 0:
18467  * start += shape
18468  * if start < 0: # <<<<<<<<<<<<<<
18469  * start = 0
18470  * elif start >= shape:
18471  */
18472  }
18473 
18474  /* "View.MemoryView":844
18475  *
18476  * if have_start:
18477  * if start < 0: # <<<<<<<<<<<<<<
18478  * start += shape
18479  * if start < 0:
18480  */
18481  goto __pyx_L12;
18482  }
18483 
18484  /* "View.MemoryView":848
18485  * if start < 0:
18486  * start = 0
18487  * elif start >= shape: # <<<<<<<<<<<<<<
18488  * if negative_step:
18489  * start = shape - 1
18490  */
18491  __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
18492  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
18493  if (__pyx_t_2) {
18494 
18495  /* "View.MemoryView":849
18496  * start = 0
18497  * elif start >= shape:
18498  * if negative_step: # <<<<<<<<<<<<<<
18499  * start = shape - 1
18500  * else:
18501  */
18502  __Pyx_TraceLine(849,1,__PYX_ERR(1, 849, __pyx_L1_error))
18503  __pyx_t_2 = (__pyx_v_negative_step != 0);
18504  if (__pyx_t_2) {
18505 
18506  /* "View.MemoryView":850
18507  * elif start >= shape:
18508  * if negative_step:
18509  * start = shape - 1 # <<<<<<<<<<<<<<
18510  * else:
18511  * start = shape
18512  */
18513  __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
18514  __pyx_v_start = (__pyx_v_shape - 1);
18515 
18516  /* "View.MemoryView":849
18517  * start = 0
18518  * elif start >= shape:
18519  * if negative_step: # <<<<<<<<<<<<<<
18520  * start = shape - 1
18521  * else:
18522  */
18523  goto __pyx_L14;
18524  }
18525 
18526  /* "View.MemoryView":852
18527  * start = shape - 1
18528  * else:
18529  * start = shape # <<<<<<<<<<<<<<
18530  * else:
18531  * if negative_step:
18532  */
18533  __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
18534  /*else*/ {
18535  __pyx_v_start = __pyx_v_shape;
18536  }
18537  __pyx_L14:;
18538 
18539  /* "View.MemoryView":848
18540  * if start < 0:
18541  * start = 0
18542  * elif start >= shape: # <<<<<<<<<<<<<<
18543  * if negative_step:
18544  * start = shape - 1
18545  */
18546  }
18547  __pyx_L12:;
18548 
18549  /* "View.MemoryView":843
18550  *
18551  *
18552  * if have_start: # <<<<<<<<<<<<<<
18553  * if start < 0:
18554  * start += shape
18555  */
18556  goto __pyx_L11;
18557  }
18558 
18559  /* "View.MemoryView":854
18560  * start = shape
18561  * else:
18562  * if negative_step: # <<<<<<<<<<<<<<
18563  * start = shape - 1
18564  * else:
18565  */
18566  __Pyx_TraceLine(854,1,__PYX_ERR(1, 854, __pyx_L1_error))
18567  /*else*/ {
18568  __pyx_t_2 = (__pyx_v_negative_step != 0);
18569  if (__pyx_t_2) {
18570 
18571  /* "View.MemoryView":855
18572  * else:
18573  * if negative_step:
18574  * start = shape - 1 # <<<<<<<<<<<<<<
18575  * else:
18576  * start = 0
18577  */
18578  __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
18579  __pyx_v_start = (__pyx_v_shape - 1);
18580 
18581  /* "View.MemoryView":854
18582  * start = shape
18583  * else:
18584  * if negative_step: # <<<<<<<<<<<<<<
18585  * start = shape - 1
18586  * else:
18587  */
18588  goto __pyx_L15;
18589  }
18590 
18591  /* "View.MemoryView":857
18592  * start = shape - 1
18593  * else:
18594  * start = 0 # <<<<<<<<<<<<<<
18595  *
18596  * if have_stop:
18597  */
18598  __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
18599  /*else*/ {
18600  __pyx_v_start = 0;
18601  }
18602  __pyx_L15:;
18603  }
18604  __pyx_L11:;
18605 
18606  /* "View.MemoryView":859
18607  * start = 0
18608  *
18609  * if have_stop: # <<<<<<<<<<<<<<
18610  * if stop < 0:
18611  * stop += shape
18612  */
18613  __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
18614  __pyx_t_2 = (__pyx_v_have_stop != 0);
18615  if (__pyx_t_2) {
18616 
18617  /* "View.MemoryView":860
18618  *
18619  * if have_stop:
18620  * if stop < 0: # <<<<<<<<<<<<<<
18621  * stop += shape
18622  * if stop < 0:
18623  */
18624  __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
18625  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
18626  if (__pyx_t_2) {
18627 
18628  /* "View.MemoryView":861
18629  * if have_stop:
18630  * if stop < 0:
18631  * stop += shape # <<<<<<<<<<<<<<
18632  * if stop < 0:
18633  * stop = 0
18634  */
18635  __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
18636  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
18637 
18638  /* "View.MemoryView":862
18639  * if stop < 0:
18640  * stop += shape
18641  * if stop < 0: # <<<<<<<<<<<<<<
18642  * stop = 0
18643  * elif stop > shape:
18644  */
18645  __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
18646  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
18647  if (__pyx_t_2) {
18648 
18649  /* "View.MemoryView":863
18650  * stop += shape
18651  * if stop < 0:
18652  * stop = 0 # <<<<<<<<<<<<<<
18653  * elif stop > shape:
18654  * stop = shape
18655  */
18656  __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
18657  __pyx_v_stop = 0;
18658 
18659  /* "View.MemoryView":862
18660  * if stop < 0:
18661  * stop += shape
18662  * if stop < 0: # <<<<<<<<<<<<<<
18663  * stop = 0
18664  * elif stop > shape:
18665  */
18666  }
18667 
18668  /* "View.MemoryView":860
18669  *
18670  * if have_stop:
18671  * if stop < 0: # <<<<<<<<<<<<<<
18672  * stop += shape
18673  * if stop < 0:
18674  */
18675  goto __pyx_L17;
18676  }
18677 
18678  /* "View.MemoryView":864
18679  * if stop < 0:
18680  * stop = 0
18681  * elif stop > shape: # <<<<<<<<<<<<<<
18682  * stop = shape
18683  * else:
18684  */
18685  __Pyx_TraceLine(864,1,__PYX_ERR(1, 864, __pyx_L1_error))
18686  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
18687  if (__pyx_t_2) {
18688 
18689  /* "View.MemoryView":865
18690  * stop = 0
18691  * elif stop > shape:
18692  * stop = shape # <<<<<<<<<<<<<<
18693  * else:
18694  * if negative_step:
18695  */
18696  __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
18697  __pyx_v_stop = __pyx_v_shape;
18698 
18699  /* "View.MemoryView":864
18700  * if stop < 0:
18701  * stop = 0
18702  * elif stop > shape: # <<<<<<<<<<<<<<
18703  * stop = shape
18704  * else:
18705  */
18706  }
18707  __pyx_L17:;
18708 
18709  /* "View.MemoryView":859
18710  * start = 0
18711  *
18712  * if have_stop: # <<<<<<<<<<<<<<
18713  * if stop < 0:
18714  * stop += shape
18715  */
18716  goto __pyx_L16;
18717  }
18718 
18719  /* "View.MemoryView":867
18720  * stop = shape
18721  * else:
18722  * if negative_step: # <<<<<<<<<<<<<<
18723  * stop = -1
18724  * else:
18725  */
18726  __Pyx_TraceLine(867,1,__PYX_ERR(1, 867, __pyx_L1_error))
18727  /*else*/ {
18728  __pyx_t_2 = (__pyx_v_negative_step != 0);
18729  if (__pyx_t_2) {
18730 
18731  /* "View.MemoryView":868
18732  * else:
18733  * if negative_step:
18734  * stop = -1 # <<<<<<<<<<<<<<
18735  * else:
18736  * stop = shape
18737  */
18738  __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
18739  __pyx_v_stop = -1L;
18740 
18741  /* "View.MemoryView":867
18742  * stop = shape
18743  * else:
18744  * if negative_step: # <<<<<<<<<<<<<<
18745  * stop = -1
18746  * else:
18747  */
18748  goto __pyx_L19;
18749  }
18750 
18751  /* "View.MemoryView":870
18752  * stop = -1
18753  * else:
18754  * stop = shape # <<<<<<<<<<<<<<
18755  *
18756  * if not have_step:
18757  */
18758  __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
18759  /*else*/ {
18760  __pyx_v_stop = __pyx_v_shape;
18761  }
18762  __pyx_L19:;
18763  }
18764  __pyx_L16:;
18765 
18766  /* "View.MemoryView":872
18767  * stop = shape
18768  *
18769  * if not have_step: # <<<<<<<<<<<<<<
18770  * step = 1
18771  *
18772  */
18773  __Pyx_TraceLine(872,1,__PYX_ERR(1, 872, __pyx_L1_error))
18774  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
18775  if (__pyx_t_2) {
18776 
18777  /* "View.MemoryView":873
18778  *
18779  * if not have_step:
18780  * step = 1 # <<<<<<<<<<<<<<
18781  *
18782  *
18783  */
18784  __Pyx_TraceLine(873,1,__PYX_ERR(1, 873, __pyx_L1_error))
18785  __pyx_v_step = 1;
18786 
18787  /* "View.MemoryView":872
18788  * stop = shape
18789  *
18790  * if not have_step: # <<<<<<<<<<<<<<
18791  * step = 1
18792  *
18793  */
18794  }
18795 
18796  /* "View.MemoryView":877
18797  *
18798  * with cython.cdivision(True):
18799  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
18800  *
18801  * if (stop - start) - step * new_shape:
18802  */
18803  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
18804 
18805  /* "View.MemoryView":879
18806  * new_shape = (stop - start) // step
18807  *
18808  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
18809  * new_shape += 1
18810  *
18811  */
18812  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
18813  if (__pyx_t_2) {
18814 
18815  /* "View.MemoryView":880
18816  *
18817  * if (stop - start) - step * new_shape:
18818  * new_shape += 1 # <<<<<<<<<<<<<<
18819  *
18820  * if new_shape < 0:
18821  */
18822  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
18823 
18824  /* "View.MemoryView":879
18825  * new_shape = (stop - start) // step
18826  *
18827  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
18828  * new_shape += 1
18829  *
18830  */
18831  }
18832 
18833  /* "View.MemoryView":882
18834  * new_shape += 1
18835  *
18836  * if new_shape < 0: # <<<<<<<<<<<<<<
18837  * new_shape = 0
18838  *
18839  */
18840  __Pyx_TraceLine(882,1,__PYX_ERR(1, 882, __pyx_L1_error))
18841  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
18842  if (__pyx_t_2) {
18843 
18844  /* "View.MemoryView":883
18845  *
18846  * if new_shape < 0:
18847  * new_shape = 0 # <<<<<<<<<<<<<<
18848  *
18849  *
18850  */
18851  __Pyx_TraceLine(883,1,__PYX_ERR(1, 883, __pyx_L1_error))
18852  __pyx_v_new_shape = 0;
18853 
18854  /* "View.MemoryView":882
18855  * new_shape += 1
18856  *
18857  * if new_shape < 0: # <<<<<<<<<<<<<<
18858  * new_shape = 0
18859  *
18860  */
18861  }
18862 
18863  /* "View.MemoryView":886
18864  *
18865  *
18866  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
18867  * dst.shape[new_ndim] = new_shape
18868  * dst.suboffsets[new_ndim] = suboffset
18869  */
18870  __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
18871  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
18872 
18873  /* "View.MemoryView":887
18874  *
18875  * dst.strides[new_ndim] = stride * step
18876  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
18877  * dst.suboffsets[new_ndim] = suboffset
18878  *
18879  */
18880  __Pyx_TraceLine(887,1,__PYX_ERR(1, 887, __pyx_L1_error))
18881  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
18882 
18883  /* "View.MemoryView":888
18884  * dst.strides[new_ndim] = stride * step
18885  * dst.shape[new_ndim] = new_shape
18886  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
18887  *
18888  *
18889  */
18890  __Pyx_TraceLine(888,1,__PYX_ERR(1, 888, __pyx_L1_error))
18891  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
18892  }
18893  __pyx_L3:;
18894 
18895  /* "View.MemoryView":891
18896  *
18897  *
18898  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
18899  * dst.data += start * stride
18900  * else:
18901  */
18902  __Pyx_TraceLine(891,1,__PYX_ERR(1, 891, __pyx_L1_error))
18903  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
18904  if (__pyx_t_2) {
18905 
18906  /* "View.MemoryView":892
18907  *
18908  * if suboffset_dim[0] < 0:
18909  * dst.data += start * stride # <<<<<<<<<<<<<<
18910  * else:
18911  * dst.suboffsets[suboffset_dim[0]] += start * stride
18912  */
18913  __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
18914  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
18915 
18916  /* "View.MemoryView":891
18917  *
18918  *
18919  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
18920  * dst.data += start * stride
18921  * else:
18922  */
18923  goto __pyx_L23;
18924  }
18925 
18926  /* "View.MemoryView":894
18927  * dst.data += start * stride
18928  * else:
18929  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
18930  *
18931  * if suboffset >= 0:
18932  */
18933  __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
18934  /*else*/ {
18935  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
18936  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
18937  }
18938  __pyx_L23:;
18939 
18940  /* "View.MemoryView":896
18941  * dst.suboffsets[suboffset_dim[0]] += start * stride
18942  *
18943  * if suboffset >= 0: # <<<<<<<<<<<<<<
18944  * if not is_slice:
18945  * if new_ndim == 0:
18946  */
18947  __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
18948  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
18949  if (__pyx_t_2) {
18950 
18951  /* "View.MemoryView":897
18952  *
18953  * if suboffset >= 0:
18954  * if not is_slice: # <<<<<<<<<<<<<<
18955  * if new_ndim == 0:
18956  * dst.data = (<char **> dst.data)[0] + suboffset
18957  */
18958  __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
18959  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
18960  if (__pyx_t_2) {
18961 
18962  /* "View.MemoryView":898
18963  * if suboffset >= 0:
18964  * if not is_slice:
18965  * if new_ndim == 0: # <<<<<<<<<<<<<<
18966  * dst.data = (<char **> dst.data)[0] + suboffset
18967  * else:
18968  */
18969  __Pyx_TraceLine(898,1,__PYX_ERR(1, 898, __pyx_L1_error))
18970  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
18971  if (__pyx_t_2) {
18972 
18973  /* "View.MemoryView":899
18974  * if not is_slice:
18975  * if new_ndim == 0:
18976  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
18977  * else:
18978  * _err_dim(IndexError, "All dimensions preceding dimension %d "
18979  */
18980  __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
18981  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
18982 
18983  /* "View.MemoryView":898
18984  * if suboffset >= 0:
18985  * if not is_slice:
18986  * if new_ndim == 0: # <<<<<<<<<<<<<<
18987  * dst.data = (<char **> dst.data)[0] + suboffset
18988  * else:
18989  */
18990  goto __pyx_L26;
18991  }
18992 
18993  /* "View.MemoryView":901
18994  * dst.data = (<char **> dst.data)[0] + suboffset
18995  * else:
18996  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
18997  * "must be indexed and not sliced", dim)
18998  * else:
18999  */
19000  __Pyx_TraceLine(901,1,__PYX_ERR(1, 901, __pyx_L1_error))
19001  /*else*/ {
19002 
19003  /* "View.MemoryView":902
19004  * else:
19005  * _err_dim(IndexError, "All dimensions preceding dimension %d "
19006  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
19007  * else:
19008  * suboffset_dim[0] = new_ndim
19009  */
19010  __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
19011  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 901, __pyx_L1_error)
19012  }
19013  __pyx_L26:;
19014 
19015  /* "View.MemoryView":897
19016  *
19017  * if suboffset >= 0:
19018  * if not is_slice: # <<<<<<<<<<<<<<
19019  * if new_ndim == 0:
19020  * dst.data = (<char **> dst.data)[0] + suboffset
19021  */
19022  goto __pyx_L25;
19023  }
19024 
19025  /* "View.MemoryView":904
19026  * "must be indexed and not sliced", dim)
19027  * else:
19028  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
19029  *
19030  * return 0
19031  */
19032  __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
19033  /*else*/ {
19034  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
19035  }
19036  __pyx_L25:;
19037 
19038  /* "View.MemoryView":896
19039  * dst.suboffsets[suboffset_dim[0]] += start * stride
19040  *
19041  * if suboffset >= 0: # <<<<<<<<<<<<<<
19042  * if not is_slice:
19043  * if new_ndim == 0:
19044  */
19045  }
19046 
19047  /* "View.MemoryView":906
19048  * suboffset_dim[0] = new_ndim
19049  *
19050  * return 0 # <<<<<<<<<<<<<<
19051  *
19052  *
19053  */
19054  __Pyx_TraceLine(906,1,__PYX_ERR(1, 906, __pyx_L1_error))
19055  __pyx_r = 0;
19056  goto __pyx_L0;
19057 
19058  /* "View.MemoryView":809
19059  *
19060  * @cname('__pyx_memoryview_slice_memviewslice')
19061  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
19062  * __Pyx_memviewslice *dst,
19063  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
19064  */
19065 
19066  /* function exit code */
19067  __pyx_L1_error:;
19068  {
19069  #ifdef WITH_THREAD
19070  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19071  #endif
19072  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19073  #ifdef WITH_THREAD
19074  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19075  #endif
19076  }
19077  __pyx_r = -1;
19078  __pyx_L0:;
19079  __Pyx_TraceReturn(Py_None, 1);
19080  return __pyx_r;
19081 }
19082 
19083 /* "View.MemoryView":912
19084  *
19085  * @cname('__pyx_pybuffer_index')
19086  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
19087  * Py_ssize_t dim) except NULL:
19088  * cdef Py_ssize_t shape, stride, suboffset = -1
19089  */
19090 
19091 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
19092  Py_ssize_t __pyx_v_shape;
19093  Py_ssize_t __pyx_v_stride;
19094  Py_ssize_t __pyx_v_suboffset;
19095  Py_ssize_t __pyx_v_itemsize;
19096  char *__pyx_v_resultp;
19097  char *__pyx_r;
19098  __Pyx_TraceDeclarations
19099  __Pyx_RefNannyDeclarations
19100  Py_ssize_t __pyx_t_1;
19101  int __pyx_t_2;
19102  PyObject *__pyx_t_3 = NULL;
19103  PyObject *__pyx_t_4 = NULL;
19104  int __pyx_lineno = 0;
19105  const char *__pyx_filename = NULL;
19106  int __pyx_clineno = 0;
19107  __Pyx_RefNannySetupContext("pybuffer_index", 0);
19108  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 912, 0, __PYX_ERR(1, 912, __pyx_L1_error));
19109 
19110  /* "View.MemoryView":914
19111  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
19112  * Py_ssize_t dim) except NULL:
19113  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
19114  * cdef Py_ssize_t itemsize = view.itemsize
19115  * cdef char *resultp
19116  */
19117  __Pyx_TraceLine(914,0,__PYX_ERR(1, 914, __pyx_L1_error))
19118  __pyx_v_suboffset = -1L;
19119 
19120  /* "View.MemoryView":915
19121  * Py_ssize_t dim) except NULL:
19122  * cdef Py_ssize_t shape, stride, suboffset = -1
19123  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
19124  * cdef char *resultp
19125  *
19126  */
19127  __Pyx_TraceLine(915,0,__PYX_ERR(1, 915, __pyx_L1_error))
19128  __pyx_t_1 = __pyx_v_view->itemsize;
19129  __pyx_v_itemsize = __pyx_t_1;
19130 
19131  /* "View.MemoryView":918
19132  * cdef char *resultp
19133  *
19134  * if view.ndim == 0: # <<<<<<<<<<<<<<
19135  * shape = view.len / itemsize
19136  * stride = itemsize
19137  */
19138  __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
19139  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
19140  if (__pyx_t_2) {
19141 
19142  /* "View.MemoryView":919
19143  *
19144  * if view.ndim == 0:
19145  * shape = view.len / itemsize # <<<<<<<<<<<<<<
19146  * stride = itemsize
19147  * else:
19148  */
19149  __Pyx_TraceLine(919,0,__PYX_ERR(1, 919, __pyx_L1_error))
19150  if (unlikely(__pyx_v_itemsize == 0)) {
19151  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
19152  __PYX_ERR(1, 919, __pyx_L1_error)
19153  }
19154  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
19155  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
19156  __PYX_ERR(1, 919, __pyx_L1_error)
19157  }
19158  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
19159 
19160  /* "View.MemoryView":920
19161  * if view.ndim == 0:
19162  * shape = view.len / itemsize
19163  * stride = itemsize # <<<<<<<<<<<<<<
19164  * else:
19165  * shape = view.shape[dim]
19166  */
19167  __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
19168  __pyx_v_stride = __pyx_v_itemsize;
19169 
19170  /* "View.MemoryView":918
19171  * cdef char *resultp
19172  *
19173  * if view.ndim == 0: # <<<<<<<<<<<<<<
19174  * shape = view.len / itemsize
19175  * stride = itemsize
19176  */
19177  goto __pyx_L3;
19178  }
19179 
19180  /* "View.MemoryView":922
19181  * stride = itemsize
19182  * else:
19183  * shape = view.shape[dim] # <<<<<<<<<<<<<<
19184  * stride = view.strides[dim]
19185  * if view.suboffsets != NULL:
19186  */
19187  __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
19188  /*else*/ {
19189  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
19190 
19191  /* "View.MemoryView":923
19192  * else:
19193  * shape = view.shape[dim]
19194  * stride = view.strides[dim] # <<<<<<<<<<<<<<
19195  * if view.suboffsets != NULL:
19196  * suboffset = view.suboffsets[dim]
19197  */
19198  __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
19199  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
19200 
19201  /* "View.MemoryView":924
19202  * shape = view.shape[dim]
19203  * stride = view.strides[dim]
19204  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
19205  * suboffset = view.suboffsets[dim]
19206  *
19207  */
19208  __Pyx_TraceLine(924,0,__PYX_ERR(1, 924, __pyx_L1_error))
19209  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
19210  if (__pyx_t_2) {
19211 
19212  /* "View.MemoryView":925
19213  * stride = view.strides[dim]
19214  * if view.suboffsets != NULL:
19215  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
19216  *
19217  * if index < 0:
19218  */
19219  __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
19220  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
19221 
19222  /* "View.MemoryView":924
19223  * shape = view.shape[dim]
19224  * stride = view.strides[dim]
19225  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
19226  * suboffset = view.suboffsets[dim]
19227  *
19228  */
19229  }
19230  }
19231  __pyx_L3:;
19232 
19233  /* "View.MemoryView":927
19234  * suboffset = view.suboffsets[dim]
19235  *
19236  * if index < 0: # <<<<<<<<<<<<<<
19237  * index += view.shape[dim]
19238  * if index < 0:
19239  */
19240  __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
19241  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
19242  if (__pyx_t_2) {
19243 
19244  /* "View.MemoryView":928
19245  *
19246  * if index < 0:
19247  * index += view.shape[dim] # <<<<<<<<<<<<<<
19248  * if index < 0:
19249  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19250  */
19251  __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
19252  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
19253 
19254  /* "View.MemoryView":929
19255  * if index < 0:
19256  * index += view.shape[dim]
19257  * if index < 0: # <<<<<<<<<<<<<<
19258  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19259  *
19260  */
19261  __Pyx_TraceLine(929,0,__PYX_ERR(1, 929, __pyx_L1_error))
19262  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
19263  if (unlikely(__pyx_t_2)) {
19264 
19265  /* "View.MemoryView":930
19266  * index += view.shape[dim]
19267  * if index < 0:
19268  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
19269  *
19270  * if index >= shape:
19271  */
19272  __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
19273  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
19274  __Pyx_GOTREF(__pyx_t_3);
19275  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 930, __pyx_L1_error)
19276  __Pyx_GOTREF(__pyx_t_4);
19277  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19278  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 930, __pyx_L1_error)
19279  __Pyx_GOTREF(__pyx_t_3);
19280  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19281  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19282  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19283  __PYX_ERR(1, 930, __pyx_L1_error)
19284 
19285  /* "View.MemoryView":929
19286  * if index < 0:
19287  * index += view.shape[dim]
19288  * if index < 0: # <<<<<<<<<<<<<<
19289  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19290  *
19291  */
19292  }
19293 
19294  /* "View.MemoryView":927
19295  * suboffset = view.suboffsets[dim]
19296  *
19297  * if index < 0: # <<<<<<<<<<<<<<
19298  * index += view.shape[dim]
19299  * if index < 0:
19300  */
19301  }
19302 
19303  /* "View.MemoryView":932
19304  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19305  *
19306  * if index >= shape: # <<<<<<<<<<<<<<
19307  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19308  *
19309  */
19310  __Pyx_TraceLine(932,0,__PYX_ERR(1, 932, __pyx_L1_error))
19311  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
19312  if (unlikely(__pyx_t_2)) {
19313 
19314  /* "View.MemoryView":933
19315  *
19316  * if index >= shape:
19317  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
19318  *
19319  * resultp = bufp + index * stride
19320  */
19321  __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
19322  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
19323  __Pyx_GOTREF(__pyx_t_3);
19324  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 933, __pyx_L1_error)
19325  __Pyx_GOTREF(__pyx_t_4);
19326  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19327  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 933, __pyx_L1_error)
19328  __Pyx_GOTREF(__pyx_t_3);
19329  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19330  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19331  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19332  __PYX_ERR(1, 933, __pyx_L1_error)
19333 
19334  /* "View.MemoryView":932
19335  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19336  *
19337  * if index >= shape: # <<<<<<<<<<<<<<
19338  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19339  *
19340  */
19341  }
19342 
19343  /* "View.MemoryView":935
19344  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
19345  *
19346  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
19347  * if suboffset >= 0:
19348  * resultp = (<char **> resultp)[0] + suboffset
19349  */
19350  __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
19351  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
19352 
19353  /* "View.MemoryView":936
19354  *
19355  * resultp = bufp + index * stride
19356  * if suboffset >= 0: # <<<<<<<<<<<<<<
19357  * resultp = (<char **> resultp)[0] + suboffset
19358  *
19359  */
19360  __Pyx_TraceLine(936,0,__PYX_ERR(1, 936, __pyx_L1_error))
19361  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
19362  if (__pyx_t_2) {
19363 
19364  /* "View.MemoryView":937
19365  * resultp = bufp + index * stride
19366  * if suboffset >= 0:
19367  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
19368  *
19369  * return resultp
19370  */
19371  __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
19372  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
19373 
19374  /* "View.MemoryView":936
19375  *
19376  * resultp = bufp + index * stride
19377  * if suboffset >= 0: # <<<<<<<<<<<<<<
19378  * resultp = (<char **> resultp)[0] + suboffset
19379  *
19380  */
19381  }
19382 
19383  /* "View.MemoryView":939
19384  * resultp = (<char **> resultp)[0] + suboffset
19385  *
19386  * return resultp # <<<<<<<<<<<<<<
19387  *
19388  *
19389  */
19390  __Pyx_TraceLine(939,0,__PYX_ERR(1, 939, __pyx_L1_error))
19391  __pyx_r = __pyx_v_resultp;
19392  goto __pyx_L0;
19393 
19394  /* "View.MemoryView":912
19395  *
19396  * @cname('__pyx_pybuffer_index')
19397  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
19398  * Py_ssize_t dim) except NULL:
19399  * cdef Py_ssize_t shape, stride, suboffset = -1
19400  */
19401 
19402  /* function exit code */
19403  __pyx_L1_error:;
19404  __Pyx_XDECREF(__pyx_t_3);
19405  __Pyx_XDECREF(__pyx_t_4);
19406  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
19407  __pyx_r = NULL;
19408  __pyx_L0:;
19409  __Pyx_TraceReturn(Py_None, 0);
19410  __Pyx_RefNannyFinishContext();
19411  return __pyx_r;
19412 }
19413 
19414 /* "View.MemoryView":945
19415  *
19416  * @cname('__pyx_memslice_transpose')
19417  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
19418  * cdef int ndim = memslice.memview.view.ndim
19419  *
19420  */
19421 
19422 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
19423  int __pyx_v_ndim;
19424  Py_ssize_t *__pyx_v_shape;
19425  Py_ssize_t *__pyx_v_strides;
19426  int __pyx_v_i;
19427  int __pyx_v_j;
19428  int __pyx_r;
19429  __Pyx_TraceDeclarations
19430  int __pyx_t_1;
19431  Py_ssize_t *__pyx_t_2;
19432  long __pyx_t_3;
19433  long __pyx_t_4;
19434  Py_ssize_t __pyx_t_5;
19435  Py_ssize_t __pyx_t_6;
19436  int __pyx_t_7;
19437  int __pyx_t_8;
19438  int __pyx_t_9;
19439  int __pyx_lineno = 0;
19440  const char *__pyx_filename = NULL;
19441  int __pyx_clineno = 0;
19442  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 945, 1, __PYX_ERR(1, 945, __pyx_L1_error));
19443 
19444  /* "View.MemoryView":946
19445  * @cname('__pyx_memslice_transpose')
19446  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
19447  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
19448  *
19449  * cdef Py_ssize_t *shape = memslice.shape
19450  */
19451  __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
19452  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
19453  __pyx_v_ndim = __pyx_t_1;
19454 
19455  /* "View.MemoryView":948
19456  * cdef int ndim = memslice.memview.view.ndim
19457  *
19458  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
19459  * cdef Py_ssize_t *strides = memslice.strides
19460  *
19461  */
19462  __Pyx_TraceLine(948,1,__PYX_ERR(1, 948, __pyx_L1_error))
19463  __pyx_t_2 = __pyx_v_memslice->shape;
19464  __pyx_v_shape = __pyx_t_2;
19465 
19466  /* "View.MemoryView":949
19467  *
19468  * cdef Py_ssize_t *shape = memslice.shape
19469  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
19470  *
19471  *
19472  */
19473  __Pyx_TraceLine(949,1,__PYX_ERR(1, 949, __pyx_L1_error))
19474  __pyx_t_2 = __pyx_v_memslice->strides;
19475  __pyx_v_strides = __pyx_t_2;
19476 
19477  /* "View.MemoryView":953
19478  *
19479  * cdef int i, j
19480  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
19481  * j = ndim - 1 - i
19482  * strides[i], strides[j] = strides[j], strides[i]
19483  */
19484  __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
19485  __pyx_t_3 = (__pyx_v_ndim / 2);
19486  __pyx_t_4 = __pyx_t_3;
19487  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
19488  __pyx_v_i = __pyx_t_1;
19489 
19490  /* "View.MemoryView":954
19491  * cdef int i, j
19492  * for i in range(ndim / 2):
19493  * j = ndim - 1 - i # <<<<<<<<<<<<<<
19494  * strides[i], strides[j] = strides[j], strides[i]
19495  * shape[i], shape[j] = shape[j], shape[i]
19496  */
19497  __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
19498  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
19499 
19500  /* "View.MemoryView":955
19501  * for i in range(ndim / 2):
19502  * j = ndim - 1 - i
19503  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
19504  * shape[i], shape[j] = shape[j], shape[i]
19505  *
19506  */
19507  __Pyx_TraceLine(955,1,__PYX_ERR(1, 955, __pyx_L1_error))
19508  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
19509  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
19510  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
19511  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
19512 
19513  /* "View.MemoryView":956
19514  * j = ndim - 1 - i
19515  * strides[i], strides[j] = strides[j], strides[i]
19516  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
19517  *
19518  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
19519  */
19520  __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
19521  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
19522  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
19523  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
19524  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
19525 
19526  /* "View.MemoryView":958
19527  * shape[i], shape[j] = shape[j], shape[i]
19528  *
19529  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
19530  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
19531  *
19532  */
19533  __Pyx_TraceLine(958,1,__PYX_ERR(1, 958, __pyx_L1_error))
19534  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
19535  if (!__pyx_t_8) {
19536  } else {
19537  __pyx_t_7 = __pyx_t_8;
19538  goto __pyx_L6_bool_binop_done;
19539  }
19540  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
19541  __pyx_t_7 = __pyx_t_8;
19542  __pyx_L6_bool_binop_done:;
19543  if (__pyx_t_7) {
19544 
19545  /* "View.MemoryView":959
19546  *
19547  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
19548  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
19549  *
19550  * return 1
19551  */
19552  __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
19553  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 959, __pyx_L1_error)
19554 
19555  /* "View.MemoryView":958
19556  * shape[i], shape[j] = shape[j], shape[i]
19557  *
19558  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
19559  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
19560  *
19561  */
19562  }
19563  }
19564 
19565  /* "View.MemoryView":961
19566  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
19567  *
19568  * return 1 # <<<<<<<<<<<<<<
19569  *
19570  *
19571  */
19572  __Pyx_TraceLine(961,1,__PYX_ERR(1, 961, __pyx_L1_error))
19573  __pyx_r = 1;
19574  goto __pyx_L0;
19575 
19576  /* "View.MemoryView":945
19577  *
19578  * @cname('__pyx_memslice_transpose')
19579  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
19580  * cdef int ndim = memslice.memview.view.ndim
19581  *
19582  */
19583 
19584  /* function exit code */
19585  __pyx_L1_error:;
19586  {
19587  #ifdef WITH_THREAD
19588  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19589  #endif
19590  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
19591  #ifdef WITH_THREAD
19592  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19593  #endif
19594  }
19595  __pyx_r = 0;
19596  __pyx_L0:;
19597  __Pyx_TraceReturn(Py_None, 1);
19598  return __pyx_r;
19599 }
19600 
19601 /* "View.MemoryView":978
19602  * cdef int (*to_dtype_func)(char *, object) except 0
19603  *
19604  * def __dealloc__(self): # <<<<<<<<<<<<<<
19605  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
19606  *
19607  */
19608 
19609 /* Python wrapper */
19610 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
19611 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
19612  __Pyx_RefNannyDeclarations
19613  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
19614  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
19615 
19616  /* function exit code */
19617  __Pyx_RefNannyFinishContext();
19618 }
19619 
19620 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
19621  __Pyx_TraceDeclarations
19622  __Pyx_RefNannyDeclarations
19623  int __pyx_lineno = 0;
19624  const char *__pyx_filename = NULL;
19625  int __pyx_clineno = 0;
19626  __Pyx_RefNannySetupContext("__dealloc__", 0);
19627  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 978, 0, __PYX_ERR(1, 978, __pyx_L1_error));
19628 
19629  /* "View.MemoryView":979
19630  *
19631  * def __dealloc__(self):
19632  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
19633  *
19634  * cdef convert_item_to_object(self, char *itemp):
19635  */
19636  __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
19637  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
19638 
19639  /* "View.MemoryView":978
19640  * cdef int (*to_dtype_func)(char *, object) except 0
19641  *
19642  * def __dealloc__(self): # <<<<<<<<<<<<<<
19643  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
19644  *
19645  */
19646 
19647  /* function exit code */
19648  goto __pyx_L0;
19649  __pyx_L1_error:;
19650  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19651  __pyx_L0:;
19652  __Pyx_TraceReturn(Py_None, 0);
19653  __Pyx_RefNannyFinishContext();
19654 }
19655 
19656 /* "View.MemoryView":981
19657  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
19658  *
19659  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
19660  * if self.to_object_func != NULL:
19661  * return self.to_object_func(itemp)
19662  */
19663 
19664 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
19665  PyObject *__pyx_r = NULL;
19666  __Pyx_TraceDeclarations
19667  __Pyx_RefNannyDeclarations
19668  int __pyx_t_1;
19669  PyObject *__pyx_t_2 = NULL;
19670  int __pyx_lineno = 0;
19671  const char *__pyx_filename = NULL;
19672  int __pyx_clineno = 0;
19673  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
19674  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 981, 0, __PYX_ERR(1, 981, __pyx_L1_error));
19675 
19676  /* "View.MemoryView":982
19677  *
19678  * cdef convert_item_to_object(self, char *itemp):
19679  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
19680  * return self.to_object_func(itemp)
19681  * else:
19682  */
19683  __Pyx_TraceLine(982,0,__PYX_ERR(1, 982, __pyx_L1_error))
19684  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
19685  if (__pyx_t_1) {
19686 
19687  /* "View.MemoryView":983
19688  * cdef convert_item_to_object(self, char *itemp):
19689  * if self.to_object_func != NULL:
19690  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
19691  * else:
19692  * return memoryview.convert_item_to_object(self, itemp)
19693  */
19694  __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
19695  __Pyx_XDECREF(__pyx_r);
19696  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
19697  __Pyx_GOTREF(__pyx_t_2);
19698  __pyx_r = __pyx_t_2;
19699  __pyx_t_2 = 0;
19700  goto __pyx_L0;
19701 
19702  /* "View.MemoryView":982
19703  *
19704  * cdef convert_item_to_object(self, char *itemp):
19705  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
19706  * return self.to_object_func(itemp)
19707  * else:
19708  */
19709  }
19710 
19711  /* "View.MemoryView":985
19712  * return self.to_object_func(itemp)
19713  * else:
19714  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
19715  *
19716  * cdef assign_item_from_object(self, char *itemp, object value):
19717  */
19718  __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
19719  /*else*/ {
19720  __Pyx_XDECREF(__pyx_r);
19721  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 985, __pyx_L1_error)
19722  __Pyx_GOTREF(__pyx_t_2);
19723  __pyx_r = __pyx_t_2;
19724  __pyx_t_2 = 0;
19725  goto __pyx_L0;
19726  }
19727 
19728  /* "View.MemoryView":981
19729  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
19730  *
19731  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
19732  * if self.to_object_func != NULL:
19733  * return self.to_object_func(itemp)
19734  */
19735 
19736  /* function exit code */
19737  __pyx_L1_error:;
19738  __Pyx_XDECREF(__pyx_t_2);
19739  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
19740  __pyx_r = 0;
19741  __pyx_L0:;
19742  __Pyx_XGIVEREF(__pyx_r);
19743  __Pyx_TraceReturn(__pyx_r, 0);
19744  __Pyx_RefNannyFinishContext();
19745  return __pyx_r;
19746 }
19747 
19748 /* "View.MemoryView":987
19749  * return memoryview.convert_item_to_object(self, itemp)
19750  *
19751  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
19752  * if self.to_dtype_func != NULL:
19753  * self.to_dtype_func(itemp, value)
19754  */
19755 
19756 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
19757  PyObject *__pyx_r = NULL;
19758  __Pyx_TraceDeclarations
19759  __Pyx_RefNannyDeclarations
19760  int __pyx_t_1;
19761  int __pyx_t_2;
19762  PyObject *__pyx_t_3 = NULL;
19763  int __pyx_lineno = 0;
19764  const char *__pyx_filename = NULL;
19765  int __pyx_clineno = 0;
19766  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
19767  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 987, 0, __PYX_ERR(1, 987, __pyx_L1_error));
19768 
19769  /* "View.MemoryView":988
19770  *
19771  * cdef assign_item_from_object(self, char *itemp, object value):
19772  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
19773  * self.to_dtype_func(itemp, value)
19774  * else:
19775  */
19776  __Pyx_TraceLine(988,0,__PYX_ERR(1, 988, __pyx_L1_error))
19777  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
19778  if (__pyx_t_1) {
19779 
19780  /* "View.MemoryView":989
19781  * cdef assign_item_from_object(self, char *itemp, object value):
19782  * if self.to_dtype_func != NULL:
19783  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
19784  * else:
19785  * memoryview.assign_item_from_object(self, itemp, value)
19786  */
19787  __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
19788  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 989, __pyx_L1_error)
19789 
19790  /* "View.MemoryView":988
19791  *
19792  * cdef assign_item_from_object(self, char *itemp, object value):
19793  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
19794  * self.to_dtype_func(itemp, value)
19795  * else:
19796  */
19797  goto __pyx_L3;
19798  }
19799 
19800  /* "View.MemoryView":991
19801  * self.to_dtype_func(itemp, value)
19802  * else:
19803  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
19804  *
19805  * @property
19806  */
19807  __Pyx_TraceLine(991,0,__PYX_ERR(1, 991, __pyx_L1_error))
19808  /*else*/ {
19809  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 991, __pyx_L1_error)
19810  __Pyx_GOTREF(__pyx_t_3);
19811  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19812  }
19813  __pyx_L3:;
19814 
19815  /* "View.MemoryView":987
19816  * return memoryview.convert_item_to_object(self, itemp)
19817  *
19818  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
19819  * if self.to_dtype_func != NULL:
19820  * self.to_dtype_func(itemp, value)
19821  */
19822 
19823  /* function exit code */
19824  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19825  goto __pyx_L0;
19826  __pyx_L1_error:;
19827  __Pyx_XDECREF(__pyx_t_3);
19828  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
19829  __pyx_r = 0;
19830  __pyx_L0:;
19831  __Pyx_XGIVEREF(__pyx_r);
19832  __Pyx_TraceReturn(__pyx_r, 0);
19833  __Pyx_RefNannyFinishContext();
19834  return __pyx_r;
19835 }
19836 
19837 /* "View.MemoryView":994
19838  *
19839  * @property
19840  * def base(self): # <<<<<<<<<<<<<<
19841  * return self.from_object
19842  *
19843  */
19844 
19845 /* Python wrapper */
19846 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
19847 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
19848  PyObject *__pyx_r = 0;
19849  __Pyx_RefNannyDeclarations
19850  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
19851  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
19852 
19853  /* function exit code */
19854  __Pyx_RefNannyFinishContext();
19855  return __pyx_r;
19856 }
19857 
19858 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
19859  PyObject *__pyx_r = NULL;
19860  __Pyx_TraceDeclarations
19861  __Pyx_RefNannyDeclarations
19862  int __pyx_lineno = 0;
19863  const char *__pyx_filename = NULL;
19864  int __pyx_clineno = 0;
19865  __Pyx_RefNannySetupContext("__get__", 0);
19866  __Pyx_TraceCall("__get__", __pyx_f[1], 994, 0, __PYX_ERR(1, 994, __pyx_L1_error));
19867 
19868  /* "View.MemoryView":995
19869  * @property
19870  * def base(self):
19871  * return self.from_object # <<<<<<<<<<<<<<
19872  *
19873  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
19874  */
19875  __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
19876  __Pyx_XDECREF(__pyx_r);
19877  __Pyx_INCREF(__pyx_v_self->from_object);
19878  __pyx_r = __pyx_v_self->from_object;
19879  goto __pyx_L0;
19880 
19881  /* "View.MemoryView":994
19882  *
19883  * @property
19884  * def base(self): # <<<<<<<<<<<<<<
19885  * return self.from_object
19886  *
19887  */
19888 
19889  /* function exit code */
19890  __pyx_L1_error:;
19891  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19892  __pyx_r = NULL;
19893  __pyx_L0:;
19894  __Pyx_XGIVEREF(__pyx_r);
19895  __Pyx_TraceReturn(__pyx_r, 0);
19896  __Pyx_RefNannyFinishContext();
19897  return __pyx_r;
19898 }
19899 
19900 /* "(tree fragment)":1
19901  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
19902  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19903  * def __setstate_cython__(self, __pyx_state):
19904  */
19905 
19906 /* Python wrapper */
19907 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
19908 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
19909 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19910  PyObject *__pyx_r = 0;
19911  __Pyx_RefNannyDeclarations
19912  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
19913  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
19914 
19915  /* function exit code */
19916  __Pyx_RefNannyFinishContext();
19917  return __pyx_r;
19918 }
19919 
19920 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
19921  PyObject *__pyx_r = NULL;
19922  __Pyx_TraceDeclarations
19923  __Pyx_RefNannyDeclarations
19924  PyObject *__pyx_t_1 = NULL;
19925  int __pyx_lineno = 0;
19926  const char *__pyx_filename = NULL;
19927  int __pyx_clineno = 0;
19928  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
19929  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
19930 
19931  /* "(tree fragment)":2
19932  * def __reduce_cython__(self):
19933  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19934  * def __setstate_cython__(self, __pyx_state):
19935  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19936  */
19937  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
19938  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
19939  __Pyx_GOTREF(__pyx_t_1);
19940  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19941  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19942  __PYX_ERR(1, 2, __pyx_L1_error)
19943 
19944  /* "(tree fragment)":1
19945  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
19946  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19947  * def __setstate_cython__(self, __pyx_state):
19948  */
19949 
19950  /* function exit code */
19951  __pyx_L1_error:;
19952  __Pyx_XDECREF(__pyx_t_1);
19953  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19954  __pyx_r = NULL;
19955  __Pyx_XGIVEREF(__pyx_r);
19956  __Pyx_TraceReturn(__pyx_r, 0);
19957  __Pyx_RefNannyFinishContext();
19958  return __pyx_r;
19959 }
19960 
19961 /* "(tree fragment)":3
19962  * def __reduce_cython__(self):
19963  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19964  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
19965  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19966  */
19967 
19968 /* Python wrapper */
19969 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
19970 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
19971 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19972  PyObject *__pyx_r = 0;
19973  __Pyx_RefNannyDeclarations
19974  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
19975  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
19976 
19977  /* function exit code */
19978  __Pyx_RefNannyFinishContext();
19979  return __pyx_r;
19980 }
19981 
19982 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
19983  PyObject *__pyx_r = NULL;
19984  __Pyx_TraceDeclarations
19985  __Pyx_RefNannyDeclarations
19986  PyObject *__pyx_t_1 = NULL;
19987  int __pyx_lineno = 0;
19988  const char *__pyx_filename = NULL;
19989  int __pyx_clineno = 0;
19990  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
19991  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
19992 
19993  /* "(tree fragment)":4
19994  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
19995  * def __setstate_cython__(self, __pyx_state):
19996  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
19997  */
19998  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
19999  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
20000  __Pyx_GOTREF(__pyx_t_1);
20001  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
20002  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20003  __PYX_ERR(1, 4, __pyx_L1_error)
20004 
20005  /* "(tree fragment)":3
20006  * def __reduce_cython__(self):
20007  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20008  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
20009  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
20010  */
20011 
20012  /* function exit code */
20013  __pyx_L1_error:;
20014  __Pyx_XDECREF(__pyx_t_1);
20015  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20016  __pyx_r = NULL;
20017  __Pyx_XGIVEREF(__pyx_r);
20018  __Pyx_TraceReturn(__pyx_r, 0);
20019  __Pyx_RefNannyFinishContext();
20020  return __pyx_r;
20021 }
20022 
20023 /* "View.MemoryView":1001
20024  *
20025  * @cname('__pyx_memoryview_fromslice')
20026  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
20027  * int ndim,
20028  * object (*to_object_func)(char *),
20029  */
20030 
20031 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
20032  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
20033  Py_ssize_t __pyx_v_suboffset;
20034  PyObject *__pyx_v_length = NULL;
20035  PyObject *__pyx_r = NULL;
20036  __Pyx_TraceDeclarations
20037  __Pyx_RefNannyDeclarations
20038  int __pyx_t_1;
20039  PyObject *__pyx_t_2 = NULL;
20040  PyObject *__pyx_t_3 = NULL;
20041  __Pyx_TypeInfo *__pyx_t_4;
20042  Py_buffer __pyx_t_5;
20043  Py_ssize_t *__pyx_t_6;
20044  Py_ssize_t *__pyx_t_7;
20045  Py_ssize_t *__pyx_t_8;
20046  Py_ssize_t __pyx_t_9;
20047  int __pyx_lineno = 0;
20048  const char *__pyx_filename = NULL;
20049  int __pyx_clineno = 0;
20050  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
20051  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 1001, 0, __PYX_ERR(1, 1001, __pyx_L1_error));
20052 
20053  /* "View.MemoryView":1009
20054  * cdef _memoryviewslice result
20055  *
20056  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
20057  * return None
20058  *
20059  */
20060  __Pyx_TraceLine(1009,0,__PYX_ERR(1, 1009, __pyx_L1_error))
20061  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
20062  if (__pyx_t_1) {
20063 
20064  /* "View.MemoryView":1010
20065  *
20066  * if <PyObject *> memviewslice.memview == Py_None:
20067  * return None # <<<<<<<<<<<<<<
20068  *
20069  *
20070  */
20071  __Pyx_TraceLine(1010,0,__PYX_ERR(1, 1010, __pyx_L1_error))
20072  __Pyx_XDECREF(__pyx_r);
20073  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20074  goto __pyx_L0;
20075 
20076  /* "View.MemoryView":1009
20077  * cdef _memoryviewslice result
20078  *
20079  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
20080  * return None
20081  *
20082  */
20083  }
20084 
20085  /* "View.MemoryView":1015
20086  *
20087  *
20088  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
20089  *
20090  * result.from_slice = memviewslice
20091  */
20092  __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
20093  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
20094  __Pyx_GOTREF(__pyx_t_2);
20095  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1015, __pyx_L1_error)
20096  __Pyx_GOTREF(__pyx_t_3);
20097  __Pyx_INCREF(Py_None);
20098  __Pyx_GIVEREF(Py_None);
20099  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
20100  __Pyx_INCREF(__pyx_int_0);
20101  __Pyx_GIVEREF(__pyx_int_0);
20102  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
20103  __Pyx_GIVEREF(__pyx_t_2);
20104  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
20105  __pyx_t_2 = 0;
20106  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1015, __pyx_L1_error)
20107  __Pyx_GOTREF(__pyx_t_2);
20108  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20109  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
20110  __pyx_t_2 = 0;
20111 
20112  /* "View.MemoryView":1017
20113  * result = _memoryviewslice(None, 0, dtype_is_object)
20114  *
20115  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
20116  * __PYX_INC_MEMVIEW(&memviewslice, 1)
20117  *
20118  */
20119  __Pyx_TraceLine(1017,0,__PYX_ERR(1, 1017, __pyx_L1_error))
20120  __pyx_v_result->from_slice = __pyx_v_memviewslice;
20121 
20122  /* "View.MemoryView":1018
20123  *
20124  * result.from_slice = memviewslice
20125  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
20126  *
20127  * result.from_object = (<memoryview> memviewslice.memview).base
20128  */
20129  __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
20130  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
20131 
20132  /* "View.MemoryView":1020
20133  * __PYX_INC_MEMVIEW(&memviewslice, 1)
20134  *
20135  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
20136  * result.typeinfo = memviewslice.memview.typeinfo
20137  *
20138  */
20139  __Pyx_TraceLine(1020,0,__PYX_ERR(1, 1020, __pyx_L1_error))
20140  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1020, __pyx_L1_error)
20141  __Pyx_GOTREF(__pyx_t_2);
20142  __Pyx_GIVEREF(__pyx_t_2);
20143  __Pyx_GOTREF(__pyx_v_result->from_object);
20144  __Pyx_DECREF(__pyx_v_result->from_object);
20145  __pyx_v_result->from_object = __pyx_t_2;
20146  __pyx_t_2 = 0;
20147 
20148  /* "View.MemoryView":1021
20149  *
20150  * result.from_object = (<memoryview> memviewslice.memview).base
20151  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
20152  *
20153  * result.view = memviewslice.memview.view
20154  */
20155  __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
20156  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
20157  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
20158 
20159  /* "View.MemoryView":1023
20160  * result.typeinfo = memviewslice.memview.typeinfo
20161  *
20162  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
20163  * result.view.buf = <void *> memviewslice.data
20164  * result.view.ndim = ndim
20165  */
20166  __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
20167  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
20168  __pyx_v_result->__pyx_base.view = __pyx_t_5;
20169 
20170  /* "View.MemoryView":1024
20171  *
20172  * result.view = memviewslice.memview.view
20173  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
20174  * result.view.ndim = ndim
20175  * (<__pyx_buffer *> &result.view).obj = Py_None
20176  */
20177  __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
20178  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
20179 
20180  /* "View.MemoryView":1025
20181  * result.view = memviewslice.memview.view
20182  * result.view.buf = <void *> memviewslice.data
20183  * result.view.ndim = ndim # <<<<<<<<<<<<<<
20184  * (<__pyx_buffer *> &result.view).obj = Py_None
20185  * Py_INCREF(Py_None)
20186  */
20187  __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
20188  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
20189 
20190  /* "View.MemoryView":1026
20191  * result.view.buf = <void *> memviewslice.data
20192  * result.view.ndim = ndim
20193  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
20194  * Py_INCREF(Py_None)
20195  *
20196  */
20197  __Pyx_TraceLine(1026,0,__PYX_ERR(1, 1026, __pyx_L1_error))
20198  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
20199 
20200  /* "View.MemoryView":1027
20201  * result.view.ndim = ndim
20202  * (<__pyx_buffer *> &result.view).obj = Py_None
20203  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
20204  *
20205  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
20206  */
20207  __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
20208  Py_INCREF(Py_None);
20209 
20210  /* "View.MemoryView":1029
20211  * Py_INCREF(Py_None)
20212  *
20213  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
20214  * result.flags = PyBUF_RECORDS
20215  * else:
20216  */
20217  __Pyx_TraceLine(1029,0,__PYX_ERR(1, 1029, __pyx_L1_error))
20218  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
20219  if (__pyx_t_1) {
20220 
20221  /* "View.MemoryView":1030
20222  *
20223  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
20224  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
20225  * else:
20226  * result.flags = PyBUF_RECORDS_RO
20227  */
20228  __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
20229  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
20230 
20231  /* "View.MemoryView":1029
20232  * Py_INCREF(Py_None)
20233  *
20234  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
20235  * result.flags = PyBUF_RECORDS
20236  * else:
20237  */
20238  goto __pyx_L4;
20239  }
20240 
20241  /* "View.MemoryView":1032
20242  * result.flags = PyBUF_RECORDS
20243  * else:
20244  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
20245  *
20246  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
20247  */
20248  __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
20249  /*else*/ {
20250  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
20251  }
20252  __pyx_L4:;
20253 
20254  /* "View.MemoryView":1034
20255  * result.flags = PyBUF_RECORDS_RO
20256  *
20257  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
20258  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
20259  *
20260  */
20261  __Pyx_TraceLine(1034,0,__PYX_ERR(1, 1034, __pyx_L1_error))
20262  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
20263 
20264  /* "View.MemoryView":1035
20265  *
20266  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
20267  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
20268  *
20269  *
20270  */
20271  __Pyx_TraceLine(1035,0,__PYX_ERR(1, 1035, __pyx_L1_error))
20272  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
20273 
20274  /* "View.MemoryView":1038
20275  *
20276  *
20277  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
20278  * for suboffset in result.from_slice.suboffsets[:ndim]:
20279  * if suboffset >= 0:
20280  */
20281  __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
20282  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
20283 
20284  /* "View.MemoryView":1039
20285  *
20286  * result.view.suboffsets = NULL
20287  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
20288  * if suboffset >= 0:
20289  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
20290  */
20291  __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
20292  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
20293  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
20294  __pyx_t_6 = __pyx_t_8;
20295  __pyx_v_suboffset = (__pyx_t_6[0]);
20296 
20297  /* "View.MemoryView":1040
20298  * result.view.suboffsets = NULL
20299  * for suboffset in result.from_slice.suboffsets[:ndim]:
20300  * if suboffset >= 0: # <<<<<<<<<<<<<<
20301  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
20302  * break
20303  */
20304  __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
20305  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
20306  if (__pyx_t_1) {
20307 
20308  /* "View.MemoryView":1041
20309  * for suboffset in result.from_slice.suboffsets[:ndim]:
20310  * if suboffset >= 0:
20311  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
20312  * break
20313  *
20314  */
20315  __Pyx_TraceLine(1041,0,__PYX_ERR(1, 1041, __pyx_L1_error))
20316  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
20317 
20318  /* "View.MemoryView":1042
20319  * if suboffset >= 0:
20320  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
20321  * break # <<<<<<<<<<<<<<
20322  *
20323  * result.view.len = result.view.itemsize
20324  */
20325  __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
20326  goto __pyx_L6_break;
20327 
20328  /* "View.MemoryView":1040
20329  * result.view.suboffsets = NULL
20330  * for suboffset in result.from_slice.suboffsets[:ndim]:
20331  * if suboffset >= 0: # <<<<<<<<<<<<<<
20332  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
20333  * break
20334  */
20335  }
20336  }
20337  __pyx_L6_break:;
20338 
20339  /* "View.MemoryView":1044
20340  * break
20341  *
20342  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
20343  * for length in result.view.shape[:ndim]:
20344  * result.view.len *= length
20345  */
20346  __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
20347  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
20348  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
20349 
20350  /* "View.MemoryView":1045
20351  *
20352  * result.view.len = result.view.itemsize
20353  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
20354  * result.view.len *= length
20355  *
20356  */
20357  __Pyx_TraceLine(1045,0,__PYX_ERR(1, 1045, __pyx_L1_error))
20358  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
20359  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
20360  __pyx_t_6 = __pyx_t_8;
20361  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1045, __pyx_L1_error)
20362  __Pyx_GOTREF(__pyx_t_2);
20363  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
20364  __pyx_t_2 = 0;
20365 
20366  /* "View.MemoryView":1046
20367  * result.view.len = result.view.itemsize
20368  * for length in result.view.shape[:ndim]:
20369  * result.view.len *= length # <<<<<<<<<<<<<<
20370  *
20371  * result.to_object_func = to_object_func
20372  */
20373  __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
20374  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1046, __pyx_L1_error)
20375  __Pyx_GOTREF(__pyx_t_2);
20376  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1046, __pyx_L1_error)
20377  __Pyx_GOTREF(__pyx_t_3);
20378  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20379  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1046, __pyx_L1_error)
20380  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20381  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
20382  }
20383 
20384  /* "View.MemoryView":1048
20385  * result.view.len *= length
20386  *
20387  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
20388  * result.to_dtype_func = to_dtype_func
20389  *
20390  */
20391  __Pyx_TraceLine(1048,0,__PYX_ERR(1, 1048, __pyx_L1_error))
20392  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
20393 
20394  /* "View.MemoryView":1049
20395  *
20396  * result.to_object_func = to_object_func
20397  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
20398  *
20399  * return result
20400  */
20401  __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
20402  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
20403 
20404  /* "View.MemoryView":1051
20405  * result.to_dtype_func = to_dtype_func
20406  *
20407  * return result # <<<<<<<<<<<<<<
20408  *
20409  * @cname('__pyx_memoryview_get_slice_from_memoryview')
20410  */
20411  __Pyx_TraceLine(1051,0,__PYX_ERR(1, 1051, __pyx_L1_error))
20412  __Pyx_XDECREF(__pyx_r);
20413  __Pyx_INCREF(((PyObject *)__pyx_v_result));
20414  __pyx_r = ((PyObject *)__pyx_v_result);
20415  goto __pyx_L0;
20416 
20417  /* "View.MemoryView":1001
20418  *
20419  * @cname('__pyx_memoryview_fromslice')
20420  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
20421  * int ndim,
20422  * object (*to_object_func)(char *),
20423  */
20424 
20425  /* function exit code */
20426  __pyx_L1_error:;
20427  __Pyx_XDECREF(__pyx_t_2);
20428  __Pyx_XDECREF(__pyx_t_3);
20429  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20430  __pyx_r = 0;
20431  __pyx_L0:;
20432  __Pyx_XDECREF((PyObject *)__pyx_v_result);
20433  __Pyx_XDECREF(__pyx_v_length);
20434  __Pyx_XGIVEREF(__pyx_r);
20435  __Pyx_TraceReturn(__pyx_r, 0);
20436  __Pyx_RefNannyFinishContext();
20437  return __pyx_r;
20438 }
20439 
20440 /* "View.MemoryView":1054
20441  *
20442  * @cname('__pyx_memoryview_get_slice_from_memoryview')
20443  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
20444  * __Pyx_memviewslice *mslice) except NULL:
20445  * cdef _memoryviewslice obj
20446  */
20447 
20448 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
20449  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
20450  __Pyx_memviewslice *__pyx_r;
20451  __Pyx_TraceDeclarations
20452  __Pyx_RefNannyDeclarations
20453  int __pyx_t_1;
20454  int __pyx_t_2;
20455  PyObject *__pyx_t_3 = NULL;
20456  int __pyx_lineno = 0;
20457  const char *__pyx_filename = NULL;
20458  int __pyx_clineno = 0;
20459  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
20460  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1054, 0, __PYX_ERR(1, 1054, __pyx_L1_error));
20461 
20462  /* "View.MemoryView":1057
20463  * __Pyx_memviewslice *mslice) except NULL:
20464  * cdef _memoryviewslice obj
20465  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
20466  * obj = memview
20467  * return &obj.from_slice
20468  */
20469  __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
20470  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
20471  __pyx_t_2 = (__pyx_t_1 != 0);
20472  if (__pyx_t_2) {
20473 
20474  /* "View.MemoryView":1058
20475  * cdef _memoryviewslice obj
20476  * if isinstance(memview, _memoryviewslice):
20477  * obj = memview # <<<<<<<<<<<<<<
20478  * return &obj.from_slice
20479  * else:
20480  */
20481  __Pyx_TraceLine(1058,0,__PYX_ERR(1, 1058, __pyx_L1_error))
20482  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1058, __pyx_L1_error)
20483  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
20484  __Pyx_INCREF(__pyx_t_3);
20485  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
20486  __pyx_t_3 = 0;
20487 
20488  /* "View.MemoryView":1059
20489  * if isinstance(memview, _memoryviewslice):
20490  * obj = memview
20491  * return &obj.from_slice # <<<<<<<<<<<<<<
20492  * else:
20493  * slice_copy(memview, mslice)
20494  */
20495  __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
20496  __pyx_r = (&__pyx_v_obj->from_slice);
20497  goto __pyx_L0;
20498 
20499  /* "View.MemoryView":1057
20500  * __Pyx_memviewslice *mslice) except NULL:
20501  * cdef _memoryviewslice obj
20502  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
20503  * obj = memview
20504  * return &obj.from_slice
20505  */
20506  }
20507 
20508  /* "View.MemoryView":1061
20509  * return &obj.from_slice
20510  * else:
20511  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
20512  * return mslice
20513  *
20514  */
20515  __Pyx_TraceLine(1061,0,__PYX_ERR(1, 1061, __pyx_L1_error))
20516  /*else*/ {
20517  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
20518 
20519  /* "View.MemoryView":1062
20520  * else:
20521  * slice_copy(memview, mslice)
20522  * return mslice # <<<<<<<<<<<<<<
20523  *
20524  * @cname('__pyx_memoryview_slice_copy')
20525  */
20526  __Pyx_TraceLine(1062,0,__PYX_ERR(1, 1062, __pyx_L1_error))
20527  __pyx_r = __pyx_v_mslice;
20528  goto __pyx_L0;
20529  }
20530 
20531  /* "View.MemoryView":1054
20532  *
20533  * @cname('__pyx_memoryview_get_slice_from_memoryview')
20534  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
20535  * __Pyx_memviewslice *mslice) except NULL:
20536  * cdef _memoryviewslice obj
20537  */
20538 
20539  /* function exit code */
20540  __pyx_L1_error:;
20541  __Pyx_XDECREF(__pyx_t_3);
20542  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
20543  __pyx_r = NULL;
20544  __pyx_L0:;
20545  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
20546  __Pyx_TraceReturn(Py_None, 0);
20547  __Pyx_RefNannyFinishContext();
20548  return __pyx_r;
20549 }
20550 
20551 /* "View.MemoryView":1065
20552  *
20553  * @cname('__pyx_memoryview_slice_copy')
20554  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
20555  * cdef int dim
20556  * cdef (Py_ssize_t*) shape, strides, suboffsets
20557  */
20558 
20559 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
20560  int __pyx_v_dim;
20561  Py_ssize_t *__pyx_v_shape;
20562  Py_ssize_t *__pyx_v_strides;
20563  Py_ssize_t *__pyx_v_suboffsets;
20564  __Pyx_TraceDeclarations
20565  __Pyx_RefNannyDeclarations
20566  Py_ssize_t *__pyx_t_1;
20567  int __pyx_t_2;
20568  int __pyx_t_3;
20569  int __pyx_t_4;
20570  Py_ssize_t __pyx_t_5;
20571  int __pyx_lineno = 0;
20572  const char *__pyx_filename = NULL;
20573  int __pyx_clineno = 0;
20574  __Pyx_RefNannySetupContext("slice_copy", 0);
20575  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1065, 0, __PYX_ERR(1, 1065, __pyx_L1_error));
20576 
20577  /* "View.MemoryView":1069
20578  * cdef (Py_ssize_t*) shape, strides, suboffsets
20579  *
20580  * shape = memview.view.shape # <<<<<<<<<<<<<<
20581  * strides = memview.view.strides
20582  * suboffsets = memview.view.suboffsets
20583  */
20584  __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
20585  __pyx_t_1 = __pyx_v_memview->view.shape;
20586  __pyx_v_shape = __pyx_t_1;
20587 
20588  /* "View.MemoryView":1070
20589  *
20590  * shape = memview.view.shape
20591  * strides = memview.view.strides # <<<<<<<<<<<<<<
20592  * suboffsets = memview.view.suboffsets
20593  *
20594  */
20595  __Pyx_TraceLine(1070,0,__PYX_ERR(1, 1070, __pyx_L1_error))
20596  __pyx_t_1 = __pyx_v_memview->view.strides;
20597  __pyx_v_strides = __pyx_t_1;
20598 
20599  /* "View.MemoryView":1071
20600  * shape = memview.view.shape
20601  * strides = memview.view.strides
20602  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
20603  *
20604  * dst.memview = <__pyx_memoryview *> memview
20605  */
20606  __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
20607  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
20608  __pyx_v_suboffsets = __pyx_t_1;
20609 
20610  /* "View.MemoryView":1073
20611  * suboffsets = memview.view.suboffsets
20612  *
20613  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
20614  * dst.data = <char *> memview.view.buf
20615  *
20616  */
20617  __Pyx_TraceLine(1073,0,__PYX_ERR(1, 1073, __pyx_L1_error))
20618  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
20619 
20620  /* "View.MemoryView":1074
20621  *
20622  * dst.memview = <__pyx_memoryview *> memview
20623  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
20624  *
20625  * for dim in range(memview.view.ndim):
20626  */
20627  __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
20628  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
20629 
20630  /* "View.MemoryView":1076
20631  * dst.data = <char *> memview.view.buf
20632  *
20633  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
20634  * dst.shape[dim] = shape[dim]
20635  * dst.strides[dim] = strides[dim]
20636  */
20637  __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
20638  __pyx_t_2 = __pyx_v_memview->view.ndim;
20639  __pyx_t_3 = __pyx_t_2;
20640  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20641  __pyx_v_dim = __pyx_t_4;
20642 
20643  /* "View.MemoryView":1077
20644  *
20645  * for dim in range(memview.view.ndim):
20646  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
20647  * dst.strides[dim] = strides[dim]
20648  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
20649  */
20650  __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
20651  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
20652 
20653  /* "View.MemoryView":1078
20654  * for dim in range(memview.view.ndim):
20655  * dst.shape[dim] = shape[dim]
20656  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
20657  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
20658  *
20659  */
20660  __Pyx_TraceLine(1078,0,__PYX_ERR(1, 1078, __pyx_L1_error))
20661  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
20662 
20663  /* "View.MemoryView":1079
20664  * dst.shape[dim] = shape[dim]
20665  * dst.strides[dim] = strides[dim]
20666  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
20667  *
20668  * @cname('__pyx_memoryview_copy_object')
20669  */
20670  __Pyx_TraceLine(1079,0,__PYX_ERR(1, 1079, __pyx_L1_error))
20671  if ((__pyx_v_suboffsets != 0)) {
20672  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
20673  } else {
20674  __pyx_t_5 = -1L;
20675  }
20676  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
20677  }
20678 
20679  /* "View.MemoryView":1065
20680  *
20681  * @cname('__pyx_memoryview_slice_copy')
20682  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
20683  * cdef int dim
20684  * cdef (Py_ssize_t*) shape, strides, suboffsets
20685  */
20686 
20687  /* function exit code */
20688  goto __pyx_L0;
20689  __pyx_L1_error:;
20690  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20691  __pyx_L0:;
20692  __Pyx_TraceReturn(Py_None, 0);
20693  __Pyx_RefNannyFinishContext();
20694 }
20695 
20696 /* "View.MemoryView":1082
20697  *
20698  * @cname('__pyx_memoryview_copy_object')
20699  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
20700  * "Create a new memoryview object"
20701  * cdef __Pyx_memviewslice memviewslice
20702  */
20703 
20704 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
20705  __Pyx_memviewslice __pyx_v_memviewslice;
20706  PyObject *__pyx_r = NULL;
20707  __Pyx_TraceDeclarations
20708  __Pyx_RefNannyDeclarations
20709  PyObject *__pyx_t_1 = NULL;
20710  int __pyx_lineno = 0;
20711  const char *__pyx_filename = NULL;
20712  int __pyx_clineno = 0;
20713  __Pyx_RefNannySetupContext("memoryview_copy", 0);
20714  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1082, 0, __PYX_ERR(1, 1082, __pyx_L1_error));
20715 
20716  /* "View.MemoryView":1085
20717  * "Create a new memoryview object"
20718  * cdef __Pyx_memviewslice memviewslice
20719  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
20720  * return memoryview_copy_from_slice(memview, &memviewslice)
20721  *
20722  */
20723  __Pyx_TraceLine(1085,0,__PYX_ERR(1, 1085, __pyx_L1_error))
20724  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
20725 
20726  /* "View.MemoryView":1086
20727  * cdef __Pyx_memviewslice memviewslice
20728  * slice_copy(memview, &memviewslice)
20729  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
20730  *
20731  * @cname('__pyx_memoryview_copy_object_from_slice')
20732  */
20733  __Pyx_TraceLine(1086,0,__PYX_ERR(1, 1086, __pyx_L1_error))
20734  __Pyx_XDECREF(__pyx_r);
20735  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1086, __pyx_L1_error)
20736  __Pyx_GOTREF(__pyx_t_1);
20737  __pyx_r = __pyx_t_1;
20738  __pyx_t_1 = 0;
20739  goto __pyx_L0;
20740 
20741  /* "View.MemoryView":1082
20742  *
20743  * @cname('__pyx_memoryview_copy_object')
20744  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
20745  * "Create a new memoryview object"
20746  * cdef __Pyx_memviewslice memviewslice
20747  */
20748 
20749  /* function exit code */
20750  __pyx_L1_error:;
20751  __Pyx_XDECREF(__pyx_t_1);
20752  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
20753  __pyx_r = 0;
20754  __pyx_L0:;
20755  __Pyx_XGIVEREF(__pyx_r);
20756  __Pyx_TraceReturn(__pyx_r, 0);
20757  __Pyx_RefNannyFinishContext();
20758  return __pyx_r;
20759 }
20760 
20761 /* "View.MemoryView":1089
20762  *
20763  * @cname('__pyx_memoryview_copy_object_from_slice')
20764  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
20765  * """
20766  * Create a new memoryview object from a given memoryview object and slice.
20767  */
20768 
20769 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
20770  PyObject *(*__pyx_v_to_object_func)(char *);
20771  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
20772  PyObject *__pyx_r = NULL;
20773  __Pyx_TraceDeclarations
20774  __Pyx_RefNannyDeclarations
20775  int __pyx_t_1;
20776  int __pyx_t_2;
20777  PyObject *(*__pyx_t_3)(char *);
20778  int (*__pyx_t_4)(char *, PyObject *);
20779  PyObject *__pyx_t_5 = NULL;
20780  int __pyx_lineno = 0;
20781  const char *__pyx_filename = NULL;
20782  int __pyx_clineno = 0;
20783  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
20784  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1089, 0, __PYX_ERR(1, 1089, __pyx_L1_error));
20785 
20786  /* "View.MemoryView":1096
20787  * cdef int (*to_dtype_func)(char *, object) except 0
20788  *
20789  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
20790  * to_object_func = (<_memoryviewslice> memview).to_object_func
20791  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
20792  */
20793  __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
20794  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
20795  __pyx_t_2 = (__pyx_t_1 != 0);
20796  if (__pyx_t_2) {
20797 
20798  /* "View.MemoryView":1097
20799  *
20800  * if isinstance(memview, _memoryviewslice):
20801  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
20802  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
20803  * else:
20804  */
20805  __Pyx_TraceLine(1097,0,__PYX_ERR(1, 1097, __pyx_L1_error))
20806  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
20807  __pyx_v_to_object_func = __pyx_t_3;
20808 
20809  /* "View.MemoryView":1098
20810  * if isinstance(memview, _memoryviewslice):
20811  * to_object_func = (<_memoryviewslice> memview).to_object_func
20812  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
20813  * else:
20814  * to_object_func = NULL
20815  */
20816  __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
20817  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
20818  __pyx_v_to_dtype_func = __pyx_t_4;
20819 
20820  /* "View.MemoryView":1096
20821  * cdef int (*to_dtype_func)(char *, object) except 0
20822  *
20823  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
20824  * to_object_func = (<_memoryviewslice> memview).to_object_func
20825  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
20826  */
20827  goto __pyx_L3;
20828  }
20829 
20830  /* "View.MemoryView":1100
20831  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
20832  * else:
20833  * to_object_func = NULL # <<<<<<<<<<<<<<
20834  * to_dtype_func = NULL
20835  *
20836  */
20837  __Pyx_TraceLine(1100,0,__PYX_ERR(1, 1100, __pyx_L1_error))
20838  /*else*/ {
20839  __pyx_v_to_object_func = NULL;
20840 
20841  /* "View.MemoryView":1101
20842  * else:
20843  * to_object_func = NULL
20844  * to_dtype_func = NULL # <<<<<<<<<<<<<<
20845  *
20846  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
20847  */
20848  __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
20849  __pyx_v_to_dtype_func = NULL;
20850  }
20851  __pyx_L3:;
20852 
20853  /* "View.MemoryView":1103
20854  * to_dtype_func = NULL
20855  *
20856  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
20857  * to_object_func, to_dtype_func,
20858  * memview.dtype_is_object)
20859  */
20860  __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
20861  __Pyx_XDECREF(__pyx_r);
20862 
20863  /* "View.MemoryView":1105
20864  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
20865  * to_object_func, to_dtype_func,
20866  * memview.dtype_is_object) # <<<<<<<<<<<<<<
20867  *
20868  *
20869  */
20870  __Pyx_TraceLine(1105,0,__PYX_ERR(1, 1105, __pyx_L1_error))
20871  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1103, __pyx_L1_error)
20872  __Pyx_GOTREF(__pyx_t_5);
20873  __pyx_r = __pyx_t_5;
20874  __pyx_t_5 = 0;
20875  goto __pyx_L0;
20876 
20877  /* "View.MemoryView":1089
20878  *
20879  * @cname('__pyx_memoryview_copy_object_from_slice')
20880  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
20881  * """
20882  * Create a new memoryview object from a given memoryview object and slice.
20883  */
20884 
20885  /* function exit code */
20886  __pyx_L1_error:;
20887  __Pyx_XDECREF(__pyx_t_5);
20888  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
20889  __pyx_r = 0;
20890  __pyx_L0:;
20891  __Pyx_XGIVEREF(__pyx_r);
20892  __Pyx_TraceReturn(__pyx_r, 0);
20893  __Pyx_RefNannyFinishContext();
20894  return __pyx_r;
20895 }
20896 
20897 /* "View.MemoryView":1111
20898  *
20899  *
20900  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
20901  * if arg < 0:
20902  * return -arg
20903  */
20904 
20905 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
20906  Py_ssize_t __pyx_r;
20907  __Pyx_TraceDeclarations
20908  int __pyx_t_1;
20909  int __pyx_lineno = 0;
20910  const char *__pyx_filename = NULL;
20911  int __pyx_clineno = 0;
20912  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1111, 1, __PYX_ERR(1, 1111, __pyx_L1_error));
20913 
20914  /* "View.MemoryView":1112
20915  *
20916  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
20917  * if arg < 0: # <<<<<<<<<<<<<<
20918  * return -arg
20919  * else:
20920  */
20921  __Pyx_TraceLine(1112,1,__PYX_ERR(1, 1112, __pyx_L1_error))
20922  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
20923  if (__pyx_t_1) {
20924 
20925  /* "View.MemoryView":1113
20926  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
20927  * if arg < 0:
20928  * return -arg # <<<<<<<<<<<<<<
20929  * else:
20930  * return arg
20931  */
20932  __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
20933  __pyx_r = (-__pyx_v_arg);
20934  goto __pyx_L0;
20935 
20936  /* "View.MemoryView":1112
20937  *
20938  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
20939  * if arg < 0: # <<<<<<<<<<<<<<
20940  * return -arg
20941  * else:
20942  */
20943  }
20944 
20945  /* "View.MemoryView":1115
20946  * return -arg
20947  * else:
20948  * return arg # <<<<<<<<<<<<<<
20949  *
20950  * @cname('__pyx_get_best_slice_order')
20951  */
20952  __Pyx_TraceLine(1115,1,__PYX_ERR(1, 1115, __pyx_L1_error))
20953  /*else*/ {
20954  __pyx_r = __pyx_v_arg;
20955  goto __pyx_L0;
20956  }
20957 
20958  /* "View.MemoryView":1111
20959  *
20960  *
20961  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
20962  * if arg < 0:
20963  * return -arg
20964  */
20965 
20966  /* function exit code */
20967  __pyx_L1_error:;
20968  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20969  __pyx_r = 0;
20970  __pyx_L0:;
20971  __Pyx_TraceReturn(Py_None, 1);
20972  return __pyx_r;
20973 }
20974 
20975 /* "View.MemoryView":1118
20976  *
20977  * @cname('__pyx_get_best_slice_order')
20978  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
20979  * """
20980  * Figure out the best memory access order for a given slice.
20981  */
20982 
20983 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
20984  int __pyx_v_i;
20985  Py_ssize_t __pyx_v_c_stride;
20986  Py_ssize_t __pyx_v_f_stride;
20987  char __pyx_r;
20988  __Pyx_TraceDeclarations
20989  int __pyx_t_1;
20990  int __pyx_t_2;
20991  int __pyx_t_3;
20992  int __pyx_t_4;
20993  int __pyx_lineno = 0;
20994  const char *__pyx_filename = NULL;
20995  int __pyx_clineno = 0;
20996  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1118, 1, __PYX_ERR(1, 1118, __pyx_L1_error));
20997 
20998  /* "View.MemoryView":1123
20999  * """
21000  * cdef int i
21001  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
21002  * cdef Py_ssize_t f_stride = 0
21003  *
21004  */
21005  __Pyx_TraceLine(1123,1,__PYX_ERR(1, 1123, __pyx_L1_error))
21006  __pyx_v_c_stride = 0;
21007 
21008  /* "View.MemoryView":1124
21009  * cdef int i
21010  * cdef Py_ssize_t c_stride = 0
21011  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
21012  *
21013  * for i in range(ndim - 1, -1, -1):
21014  */
21015  __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
21016  __pyx_v_f_stride = 0;
21017 
21018  /* "View.MemoryView":1126
21019  * cdef Py_ssize_t f_stride = 0
21020  *
21021  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
21022  * if mslice.shape[i] > 1:
21023  * c_stride = mslice.strides[i]
21024  */
21025  __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
21026  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
21027  __pyx_v_i = __pyx_t_1;
21028 
21029  /* "View.MemoryView":1127
21030  *
21031  * for i in range(ndim - 1, -1, -1):
21032  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
21033  * c_stride = mslice.strides[i]
21034  * break
21035  */
21036  __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
21037  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
21038  if (__pyx_t_2) {
21039 
21040  /* "View.MemoryView":1128
21041  * for i in range(ndim - 1, -1, -1):
21042  * if mslice.shape[i] > 1:
21043  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
21044  * break
21045  *
21046  */
21047  __Pyx_TraceLine(1128,1,__PYX_ERR(1, 1128, __pyx_L1_error))
21048  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
21049 
21050  /* "View.MemoryView":1129
21051  * if mslice.shape[i] > 1:
21052  * c_stride = mslice.strides[i]
21053  * break # <<<<<<<<<<<<<<
21054  *
21055  * for i in range(ndim):
21056  */
21057  __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
21058  goto __pyx_L4_break;
21059 
21060  /* "View.MemoryView":1127
21061  *
21062  * for i in range(ndim - 1, -1, -1):
21063  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
21064  * c_stride = mslice.strides[i]
21065  * break
21066  */
21067  }
21068  }
21069  __pyx_L4_break:;
21070 
21071  /* "View.MemoryView":1131
21072  * break
21073  *
21074  * for i in range(ndim): # <<<<<<<<<<<<<<
21075  * if mslice.shape[i] > 1:
21076  * f_stride = mslice.strides[i]
21077  */
21078  __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
21079  __pyx_t_1 = __pyx_v_ndim;
21080  __pyx_t_3 = __pyx_t_1;
21081  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21082  __pyx_v_i = __pyx_t_4;
21083 
21084  /* "View.MemoryView":1132
21085  *
21086  * for i in range(ndim):
21087  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
21088  * f_stride = mslice.strides[i]
21089  * break
21090  */
21091  __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
21092  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
21093  if (__pyx_t_2) {
21094 
21095  /* "View.MemoryView":1133
21096  * for i in range(ndim):
21097  * if mslice.shape[i] > 1:
21098  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
21099  * break
21100  *
21101  */
21102  __Pyx_TraceLine(1133,1,__PYX_ERR(1, 1133, __pyx_L1_error))
21103  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
21104 
21105  /* "View.MemoryView":1134
21106  * if mslice.shape[i] > 1:
21107  * f_stride = mslice.strides[i]
21108  * break # <<<<<<<<<<<<<<
21109  *
21110  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
21111  */
21112  __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
21113  goto __pyx_L7_break;
21114 
21115  /* "View.MemoryView":1132
21116  *
21117  * for i in range(ndim):
21118  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
21119  * f_stride = mslice.strides[i]
21120  * break
21121  */
21122  }
21123  }
21124  __pyx_L7_break:;
21125 
21126  /* "View.MemoryView":1136
21127  * break
21128  *
21129  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
21130  * return 'C'
21131  * else:
21132  */
21133  __Pyx_TraceLine(1136,1,__PYX_ERR(1, 1136, __pyx_L1_error))
21134  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
21135  if (__pyx_t_2) {
21136 
21137  /* "View.MemoryView":1137
21138  *
21139  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
21140  * return 'C' # <<<<<<<<<<<<<<
21141  * else:
21142  * return 'F'
21143  */
21144  __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
21145  __pyx_r = 'C';
21146  goto __pyx_L0;
21147 
21148  /* "View.MemoryView":1136
21149  * break
21150  *
21151  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
21152  * return 'C'
21153  * else:
21154  */
21155  }
21156 
21157  /* "View.MemoryView":1139
21158  * return 'C'
21159  * else:
21160  * return 'F' # <<<<<<<<<<<<<<
21161  *
21162  * @cython.cdivision(True)
21163  */
21164  __Pyx_TraceLine(1139,1,__PYX_ERR(1, 1139, __pyx_L1_error))
21165  /*else*/ {
21166  __pyx_r = 'F';
21167  goto __pyx_L0;
21168  }
21169 
21170  /* "View.MemoryView":1118
21171  *
21172  * @cname('__pyx_get_best_slice_order')
21173  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
21174  * """
21175  * Figure out the best memory access order for a given slice.
21176  */
21177 
21178  /* function exit code */
21179  __pyx_L1_error:;
21180  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21181  __pyx_r = 0;
21182  __pyx_L0:;
21183  __Pyx_TraceReturn(Py_None, 1);
21184  return __pyx_r;
21185 }
21186 
21187 /* "View.MemoryView":1142
21188  *
21189  * @cython.cdivision(True)
21190  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
21191  * char *dst_data, Py_ssize_t *dst_strides,
21192  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
21193  */
21194 
21195 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
21196  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
21197  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
21198  Py_ssize_t __pyx_v_dst_extent;
21199  Py_ssize_t __pyx_v_src_stride;
21200  Py_ssize_t __pyx_v_dst_stride;
21201  int __pyx_t_1;
21202  int __pyx_t_2;
21203  int __pyx_t_3;
21204  Py_ssize_t __pyx_t_4;
21205  Py_ssize_t __pyx_t_5;
21206  Py_ssize_t __pyx_t_6;
21207 
21208  /* "View.MemoryView":1149
21209  *
21210  * cdef Py_ssize_t i
21211  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
21212  * cdef Py_ssize_t dst_extent = dst_shape[0]
21213  * cdef Py_ssize_t src_stride = src_strides[0]
21214  */
21215  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
21216 
21217  /* "View.MemoryView":1150
21218  * cdef Py_ssize_t i
21219  * cdef Py_ssize_t src_extent = src_shape[0]
21220  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
21221  * cdef Py_ssize_t src_stride = src_strides[0]
21222  * cdef Py_ssize_t dst_stride = dst_strides[0]
21223  */
21224  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
21225 
21226  /* "View.MemoryView":1151
21227  * cdef Py_ssize_t src_extent = src_shape[0]
21228  * cdef Py_ssize_t dst_extent = dst_shape[0]
21229  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
21230  * cdef Py_ssize_t dst_stride = dst_strides[0]
21231  *
21232  */
21233  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
21234 
21235  /* "View.MemoryView":1152
21236  * cdef Py_ssize_t dst_extent = dst_shape[0]
21237  * cdef Py_ssize_t src_stride = src_strides[0]
21238  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
21239  *
21240  * if ndim == 1:
21241  */
21242  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
21243 
21244  /* "View.MemoryView":1154
21245  * cdef Py_ssize_t dst_stride = dst_strides[0]
21246  *
21247  * if ndim == 1: # <<<<<<<<<<<<<<
21248  * if (src_stride > 0 and dst_stride > 0 and
21249  * <size_t> src_stride == itemsize == <size_t> dst_stride):
21250  */
21251  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
21252  if (__pyx_t_1) {
21253 
21254  /* "View.MemoryView":1155
21255  *
21256  * if ndim == 1:
21257  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
21258  * <size_t> src_stride == itemsize == <size_t> dst_stride):
21259  * memcpy(dst_data, src_data, itemsize * dst_extent)
21260  */
21261  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
21262  if (__pyx_t_2) {
21263  } else {
21264  __pyx_t_1 = __pyx_t_2;
21265  goto __pyx_L5_bool_binop_done;
21266  }
21267  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
21268  if (__pyx_t_2) {
21269  } else {
21270  __pyx_t_1 = __pyx_t_2;
21271  goto __pyx_L5_bool_binop_done;
21272  }
21273 
21274  /* "View.MemoryView":1156
21275  * if ndim == 1:
21276  * if (src_stride > 0 and dst_stride > 0 and
21277  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
21278  * memcpy(dst_data, src_data, itemsize * dst_extent)
21279  * else:
21280  */
21281  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
21282  if (__pyx_t_2) {
21283  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
21284  }
21285  __pyx_t_3 = (__pyx_t_2 != 0);
21286  __pyx_t_1 = __pyx_t_3;
21287  __pyx_L5_bool_binop_done:;
21288 
21289  /* "View.MemoryView":1155
21290  *
21291  * if ndim == 1:
21292  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
21293  * <size_t> src_stride == itemsize == <size_t> dst_stride):
21294  * memcpy(dst_data, src_data, itemsize * dst_extent)
21295  */
21296  if (__pyx_t_1) {
21297 
21298  /* "View.MemoryView":1157
21299  * if (src_stride > 0 and dst_stride > 0 and
21300  * <size_t> src_stride == itemsize == <size_t> dst_stride):
21301  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
21302  * else:
21303  * for i in range(dst_extent):
21304  */
21305  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
21306 
21307  /* "View.MemoryView":1155
21308  *
21309  * if ndim == 1:
21310  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
21311  * <size_t> src_stride == itemsize == <size_t> dst_stride):
21312  * memcpy(dst_data, src_data, itemsize * dst_extent)
21313  */
21314  goto __pyx_L4;
21315  }
21316 
21317  /* "View.MemoryView":1159
21318  * memcpy(dst_data, src_data, itemsize * dst_extent)
21319  * else:
21320  * for i in range(dst_extent): # <<<<<<<<<<<<<<
21321  * memcpy(dst_data, src_data, itemsize)
21322  * src_data += src_stride
21323  */
21324  /*else*/ {
21325  __pyx_t_4 = __pyx_v_dst_extent;
21326  __pyx_t_5 = __pyx_t_4;
21327  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21328  __pyx_v_i = __pyx_t_6;
21329 
21330  /* "View.MemoryView":1160
21331  * else:
21332  * for i in range(dst_extent):
21333  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
21334  * src_data += src_stride
21335  * dst_data += dst_stride
21336  */
21337  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
21338 
21339  /* "View.MemoryView":1161
21340  * for i in range(dst_extent):
21341  * memcpy(dst_data, src_data, itemsize)
21342  * src_data += src_stride # <<<<<<<<<<<<<<
21343  * dst_data += dst_stride
21344  * else:
21345  */
21346  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
21347 
21348  /* "View.MemoryView":1162
21349  * memcpy(dst_data, src_data, itemsize)
21350  * src_data += src_stride
21351  * dst_data += dst_stride # <<<<<<<<<<<<<<
21352  * else:
21353  * for i in range(dst_extent):
21354  */
21355  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
21356  }
21357  }
21358  __pyx_L4:;
21359 
21360  /* "View.MemoryView":1154
21361  * cdef Py_ssize_t dst_stride = dst_strides[0]
21362  *
21363  * if ndim == 1: # <<<<<<<<<<<<<<
21364  * if (src_stride > 0 and dst_stride > 0 and
21365  * <size_t> src_stride == itemsize == <size_t> dst_stride):
21366  */
21367  goto __pyx_L3;
21368  }
21369 
21370  /* "View.MemoryView":1164
21371  * dst_data += dst_stride
21372  * else:
21373  * for i in range(dst_extent): # <<<<<<<<<<<<<<
21374  * _copy_strided_to_strided(src_data, src_strides + 1,
21375  * dst_data, dst_strides + 1,
21376  */
21377  /*else*/ {
21378  __pyx_t_4 = __pyx_v_dst_extent;
21379  __pyx_t_5 = __pyx_t_4;
21380  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21381  __pyx_v_i = __pyx_t_6;
21382 
21383  /* "View.MemoryView":1165
21384  * else:
21385  * for i in range(dst_extent):
21386  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
21387  * dst_data, dst_strides + 1,
21388  * src_shape + 1, dst_shape + 1,
21389  */
21390  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
21391 
21392  /* "View.MemoryView":1169
21393  * src_shape + 1, dst_shape + 1,
21394  * ndim - 1, itemsize)
21395  * src_data += src_stride # <<<<<<<<<<<<<<
21396  * dst_data += dst_stride
21397  *
21398  */
21399  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
21400 
21401  /* "View.MemoryView":1170
21402  * ndim - 1, itemsize)
21403  * src_data += src_stride
21404  * dst_data += dst_stride # <<<<<<<<<<<<<<
21405  *
21406  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
21407  */
21408  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
21409  }
21410  }
21411  __pyx_L3:;
21412 
21413  /* "View.MemoryView":1142
21414  *
21415  * @cython.cdivision(True)
21416  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
21417  * char *dst_data, Py_ssize_t *dst_strides,
21418  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
21419  */
21420 
21421  /* function exit code */
21422 }
21423 
21424 /* "View.MemoryView":1172
21425  * dst_data += dst_stride
21426  *
21427  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
21428  * __Pyx_memviewslice *dst,
21429  * int ndim, size_t itemsize) nogil:
21430  */
21431 
21432 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
21433  __Pyx_TraceDeclarations
21434  int __pyx_lineno = 0;
21435  const char *__pyx_filename = NULL;
21436  int __pyx_clineno = 0;
21437  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1172, 1, __PYX_ERR(1, 1172, __pyx_L1_error));
21438 
21439  /* "View.MemoryView":1175
21440  * __Pyx_memviewslice *dst,
21441  * int ndim, size_t itemsize) nogil:
21442  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
21443  * src.shape, dst.shape, ndim, itemsize)
21444  *
21445  */
21446  __Pyx_TraceLine(1175,1,__PYX_ERR(1, 1175, __pyx_L1_error))
21447  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
21448 
21449  /* "View.MemoryView":1172
21450  * dst_data += dst_stride
21451  *
21452  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
21453  * __Pyx_memviewslice *dst,
21454  * int ndim, size_t itemsize) nogil:
21455  */
21456 
21457  /* function exit code */
21458  goto __pyx_L0;
21459  __pyx_L1_error:;
21460  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21461  __pyx_L0:;
21462  __Pyx_TraceReturn(Py_None, 1);
21463 }
21464 
21465 /* "View.MemoryView":1179
21466  *
21467  * @cname('__pyx_memoryview_slice_get_size')
21468  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
21469  * "Return the size of the memory occupied by the slice in number of bytes"
21470  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
21471  */
21472 
21473 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
21474  Py_ssize_t __pyx_v_shape;
21475  Py_ssize_t __pyx_v_size;
21476  Py_ssize_t __pyx_r;
21477  __Pyx_TraceDeclarations
21478  Py_ssize_t __pyx_t_1;
21479  Py_ssize_t *__pyx_t_2;
21480  Py_ssize_t *__pyx_t_3;
21481  Py_ssize_t *__pyx_t_4;
21482  int __pyx_lineno = 0;
21483  const char *__pyx_filename = NULL;
21484  int __pyx_clineno = 0;
21485  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1179, 1, __PYX_ERR(1, 1179, __pyx_L1_error));
21486 
21487  /* "View.MemoryView":1181
21488  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
21489  * "Return the size of the memory occupied by the slice in number of bytes"
21490  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
21491  *
21492  * for shape in src.shape[:ndim]:
21493  */
21494  __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
21495  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
21496  __pyx_v_size = __pyx_t_1;
21497 
21498  /* "View.MemoryView":1183
21499  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
21500  *
21501  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
21502  * size *= shape
21503  *
21504  */
21505  __Pyx_TraceLine(1183,1,__PYX_ERR(1, 1183, __pyx_L1_error))
21506  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
21507  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
21508  __pyx_t_2 = __pyx_t_4;
21509  __pyx_v_shape = (__pyx_t_2[0]);
21510 
21511  /* "View.MemoryView":1184
21512  *
21513  * for shape in src.shape[:ndim]:
21514  * size *= shape # <<<<<<<<<<<<<<
21515  *
21516  * return size
21517  */
21518  __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
21519  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
21520  }
21521 
21522  /* "View.MemoryView":1186
21523  * size *= shape
21524  *
21525  * return size # <<<<<<<<<<<<<<
21526  *
21527  * @cname('__pyx_fill_contig_strides_array')
21528  */
21529  __Pyx_TraceLine(1186,1,__PYX_ERR(1, 1186, __pyx_L1_error))
21530  __pyx_r = __pyx_v_size;
21531  goto __pyx_L0;
21532 
21533  /* "View.MemoryView":1179
21534  *
21535  * @cname('__pyx_memoryview_slice_get_size')
21536  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
21537  * "Return the size of the memory occupied by the slice in number of bytes"
21538  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
21539  */
21540 
21541  /* function exit code */
21542  __pyx_L1_error:;
21543  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21544  __pyx_r = 0;
21545  __pyx_L0:;
21546  __Pyx_TraceReturn(Py_None, 1);
21547  return __pyx_r;
21548 }
21549 
21550 /* "View.MemoryView":1189
21551  *
21552  * @cname('__pyx_fill_contig_strides_array')
21553  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
21554  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
21555  * int ndim, char order) nogil:
21556  */
21557 
21558 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
21559  int __pyx_v_idx;
21560  Py_ssize_t __pyx_r;
21561  __Pyx_TraceDeclarations
21562  int __pyx_t_1;
21563  int __pyx_t_2;
21564  int __pyx_t_3;
21565  int __pyx_t_4;
21566  int __pyx_lineno = 0;
21567  const char *__pyx_filename = NULL;
21568  int __pyx_clineno = 0;
21569  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1189, 1, __PYX_ERR(1, 1189, __pyx_L1_error));
21570 
21571  /* "View.MemoryView":1198
21572  * cdef int idx
21573  *
21574  * if order == 'F': # <<<<<<<<<<<<<<
21575  * for idx in range(ndim):
21576  * strides[idx] = stride
21577  */
21578  __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
21579  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
21580  if (__pyx_t_1) {
21581 
21582  /* "View.MemoryView":1199
21583  *
21584  * if order == 'F':
21585  * for idx in range(ndim): # <<<<<<<<<<<<<<
21586  * strides[idx] = stride
21587  * stride *= shape[idx]
21588  */
21589  __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
21590  __pyx_t_2 = __pyx_v_ndim;
21591  __pyx_t_3 = __pyx_t_2;
21592  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
21593  __pyx_v_idx = __pyx_t_4;
21594 
21595  /* "View.MemoryView":1200
21596  * if order == 'F':
21597  * for idx in range(ndim):
21598  * strides[idx] = stride # <<<<<<<<<<<<<<
21599  * stride *= shape[idx]
21600  * else:
21601  */
21602  __Pyx_TraceLine(1200,1,__PYX_ERR(1, 1200, __pyx_L1_error))
21603  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
21604 
21605  /* "View.MemoryView":1201
21606  * for idx in range(ndim):
21607  * strides[idx] = stride
21608  * stride *= shape[idx] # <<<<<<<<<<<<<<
21609  * else:
21610  * for idx in range(ndim - 1, -1, -1):
21611  */
21612  __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
21613  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
21614  }
21615 
21616  /* "View.MemoryView":1198
21617  * cdef int idx
21618  *
21619  * if order == 'F': # <<<<<<<<<<<<<<
21620  * for idx in range(ndim):
21621  * strides[idx] = stride
21622  */
21623  goto __pyx_L3;
21624  }
21625 
21626  /* "View.MemoryView":1203
21627  * stride *= shape[idx]
21628  * else:
21629  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
21630  * strides[idx] = stride
21631  * stride *= shape[idx]
21632  */
21633  __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
21634  /*else*/ {
21635  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
21636  __pyx_v_idx = __pyx_t_2;
21637 
21638  /* "View.MemoryView":1204
21639  * else:
21640  * for idx in range(ndim - 1, -1, -1):
21641  * strides[idx] = stride # <<<<<<<<<<<<<<
21642  * stride *= shape[idx]
21643  *
21644  */
21645  __Pyx_TraceLine(1204,1,__PYX_ERR(1, 1204, __pyx_L1_error))
21646  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
21647 
21648  /* "View.MemoryView":1205
21649  * for idx in range(ndim - 1, -1, -1):
21650  * strides[idx] = stride
21651  * stride *= shape[idx] # <<<<<<<<<<<<<<
21652  *
21653  * return stride
21654  */
21655  __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
21656  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
21657  }
21658  }
21659  __pyx_L3:;
21660 
21661  /* "View.MemoryView":1207
21662  * stride *= shape[idx]
21663  *
21664  * return stride # <<<<<<<<<<<<<<
21665  *
21666  * @cname('__pyx_memoryview_copy_data_to_temp')
21667  */
21668  __Pyx_TraceLine(1207,1,__PYX_ERR(1, 1207, __pyx_L1_error))
21669  __pyx_r = __pyx_v_stride;
21670  goto __pyx_L0;
21671 
21672  /* "View.MemoryView":1189
21673  *
21674  * @cname('__pyx_fill_contig_strides_array')
21675  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
21676  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
21677  * int ndim, char order) nogil:
21678  */
21679 
21680  /* function exit code */
21681  __pyx_L1_error:;
21682  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
21683  __pyx_r = 0;
21684  __pyx_L0:;
21685  __Pyx_TraceReturn(Py_None, 1);
21686  return __pyx_r;
21687 }
21688 
21689 /* "View.MemoryView":1210
21690  *
21691  * @cname('__pyx_memoryview_copy_data_to_temp')
21692  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
21693  * __Pyx_memviewslice *tmpslice,
21694  * char order,
21695  */
21696 
21697 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
21698  int __pyx_v_i;
21699  void *__pyx_v_result;
21700  size_t __pyx_v_itemsize;
21701  size_t __pyx_v_size;
21702  void *__pyx_r;
21703  __Pyx_TraceDeclarations
21704  Py_ssize_t __pyx_t_1;
21705  int __pyx_t_2;
21706  int __pyx_t_3;
21707  struct __pyx_memoryview_obj *__pyx_t_4;
21708  int __pyx_t_5;
21709  int __pyx_t_6;
21710  int __pyx_lineno = 0;
21711  const char *__pyx_filename = NULL;
21712  int __pyx_clineno = 0;
21713  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1210, 1, __PYX_ERR(1, 1210, __pyx_L1_error));
21714 
21715  /* "View.MemoryView":1221
21716  * cdef void *result
21717  *
21718  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
21719  * cdef size_t size = slice_get_size(src, ndim)
21720  *
21721  */
21722  __Pyx_TraceLine(1221,1,__PYX_ERR(1, 1221, __pyx_L1_error))
21723  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
21724  __pyx_v_itemsize = __pyx_t_1;
21725 
21726  /* "View.MemoryView":1222
21727  *
21728  * cdef size_t itemsize = src.memview.view.itemsize
21729  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
21730  *
21731  * result = malloc(size)
21732  */
21733  __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
21734  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
21735 
21736  /* "View.MemoryView":1224
21737  * cdef size_t size = slice_get_size(src, ndim)
21738  *
21739  * result = malloc(size) # <<<<<<<<<<<<<<
21740  * if not result:
21741  * _err(MemoryError, NULL)
21742  */
21743  __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
21744  __pyx_v_result = malloc(__pyx_v_size);
21745 
21746  /* "View.MemoryView":1225
21747  *
21748  * result = malloc(size)
21749  * if not result: # <<<<<<<<<<<<<<
21750  * _err(MemoryError, NULL)
21751  *
21752  */
21753  __Pyx_TraceLine(1225,1,__PYX_ERR(1, 1225, __pyx_L1_error))
21754  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
21755  if (__pyx_t_2) {
21756 
21757  /* "View.MemoryView":1226
21758  * result = malloc(size)
21759  * if not result:
21760  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
21761  *
21762  *
21763  */
21764  __Pyx_TraceLine(1226,1,__PYX_ERR(1, 1226, __pyx_L1_error))
21765  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1226, __pyx_L1_error)
21766 
21767  /* "View.MemoryView":1225
21768  *
21769  * result = malloc(size)
21770  * if not result: # <<<<<<<<<<<<<<
21771  * _err(MemoryError, NULL)
21772  *
21773  */
21774  }
21775 
21776  /* "View.MemoryView":1229
21777  *
21778  *
21779  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
21780  * tmpslice.memview = src.memview
21781  * for i in range(ndim):
21782  */
21783  __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
21784  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
21785 
21786  /* "View.MemoryView":1230
21787  *
21788  * tmpslice.data = <char *> result
21789  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
21790  * for i in range(ndim):
21791  * tmpslice.shape[i] = src.shape[i]
21792  */
21793  __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
21794  __pyx_t_4 = __pyx_v_src->memview;
21795  __pyx_v_tmpslice->memview = __pyx_t_4;
21796 
21797  /* "View.MemoryView":1231
21798  * tmpslice.data = <char *> result
21799  * tmpslice.memview = src.memview
21800  * for i in range(ndim): # <<<<<<<<<<<<<<
21801  * tmpslice.shape[i] = src.shape[i]
21802  * tmpslice.suboffsets[i] = -1
21803  */
21804  __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
21805  __pyx_t_3 = __pyx_v_ndim;
21806  __pyx_t_5 = __pyx_t_3;
21807  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21808  __pyx_v_i = __pyx_t_6;
21809 
21810  /* "View.MemoryView":1232
21811  * tmpslice.memview = src.memview
21812  * for i in range(ndim):
21813  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
21814  * tmpslice.suboffsets[i] = -1
21815  *
21816  */
21817  __Pyx_TraceLine(1232,1,__PYX_ERR(1, 1232, __pyx_L1_error))
21818  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
21819 
21820  /* "View.MemoryView":1233
21821  * for i in range(ndim):
21822  * tmpslice.shape[i] = src.shape[i]
21823  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
21824  *
21825  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
21826  */
21827  __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
21828  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
21829  }
21830 
21831  /* "View.MemoryView":1235
21832  * tmpslice.suboffsets[i] = -1
21833  *
21834  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
21835  * ndim, order)
21836  *
21837  */
21838  __Pyx_TraceLine(1235,1,__PYX_ERR(1, 1235, __pyx_L1_error))
21839  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
21840 
21841  /* "View.MemoryView":1239
21842  *
21843  *
21844  * for i in range(ndim): # <<<<<<<<<<<<<<
21845  * if tmpslice.shape[i] == 1:
21846  * tmpslice.strides[i] = 0
21847  */
21848  __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
21849  __pyx_t_3 = __pyx_v_ndim;
21850  __pyx_t_5 = __pyx_t_3;
21851  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21852  __pyx_v_i = __pyx_t_6;
21853 
21854  /* "View.MemoryView":1240
21855  *
21856  * for i in range(ndim):
21857  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
21858  * tmpslice.strides[i] = 0
21859  *
21860  */
21861  __Pyx_TraceLine(1240,1,__PYX_ERR(1, 1240, __pyx_L1_error))
21862  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
21863  if (__pyx_t_2) {
21864 
21865  /* "View.MemoryView":1241
21866  * for i in range(ndim):
21867  * if tmpslice.shape[i] == 1:
21868  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
21869  *
21870  * if slice_is_contig(src[0], order, ndim):
21871  */
21872  __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
21873  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
21874 
21875  /* "View.MemoryView":1240
21876  *
21877  * for i in range(ndim):
21878  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
21879  * tmpslice.strides[i] = 0
21880  *
21881  */
21882  }
21883  }
21884 
21885  /* "View.MemoryView":1243
21886  * tmpslice.strides[i] = 0
21887  *
21888  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
21889  * memcpy(result, src.data, size)
21890  * else:
21891  */
21892  __Pyx_TraceLine(1243,1,__PYX_ERR(1, 1243, __pyx_L1_error))
21893  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
21894  if (__pyx_t_2) {
21895 
21896  /* "View.MemoryView":1244
21897  *
21898  * if slice_is_contig(src[0], order, ndim):
21899  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
21900  * else:
21901  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
21902  */
21903  __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
21904  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
21905 
21906  /* "View.MemoryView":1243
21907  * tmpslice.strides[i] = 0
21908  *
21909  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
21910  * memcpy(result, src.data, size)
21911  * else:
21912  */
21913  goto __pyx_L9;
21914  }
21915 
21916  /* "View.MemoryView":1246
21917  * memcpy(result, src.data, size)
21918  * else:
21919  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
21920  *
21921  * return result
21922  */
21923  __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
21924  /*else*/ {
21925  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
21926  }
21927  __pyx_L9:;
21928 
21929  /* "View.MemoryView":1248
21930  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
21931  *
21932  * return result # <<<<<<<<<<<<<<
21933  *
21934  *
21935  */
21936  __Pyx_TraceLine(1248,1,__PYX_ERR(1, 1248, __pyx_L1_error))
21937  __pyx_r = __pyx_v_result;
21938  goto __pyx_L0;
21939 
21940  /* "View.MemoryView":1210
21941  *
21942  * @cname('__pyx_memoryview_copy_data_to_temp')
21943  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
21944  * __Pyx_memviewslice *tmpslice,
21945  * char order,
21946  */
21947 
21948  /* function exit code */
21949  __pyx_L1_error:;
21950  {
21951  #ifdef WITH_THREAD
21952  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21953  #endif
21954  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
21955  #ifdef WITH_THREAD
21956  __Pyx_PyGILState_Release(__pyx_gilstate_save);
21957  #endif
21958  }
21959  __pyx_r = NULL;
21960  __pyx_L0:;
21961  __Pyx_TraceReturn(Py_None, 1);
21962  return __pyx_r;
21963 }
21964 
21965 /* "View.MemoryView":1253
21966  *
21967  * @cname('__pyx_memoryview_err_extents')
21968  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
21969  * Py_ssize_t extent2) except -1 with gil:
21970  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
21971  */
21972 
21973 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
21974  int __pyx_r;
21975  __Pyx_TraceDeclarations
21976  __Pyx_RefNannyDeclarations
21977  PyObject *__pyx_t_1 = NULL;
21978  PyObject *__pyx_t_2 = NULL;
21979  PyObject *__pyx_t_3 = NULL;
21980  PyObject *__pyx_t_4 = NULL;
21981  int __pyx_lineno = 0;
21982  const char *__pyx_filename = NULL;
21983  int __pyx_clineno = 0;
21984  #ifdef WITH_THREAD
21985  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21986  #endif
21987  __Pyx_RefNannySetupContext("_err_extents", 0);
21988  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1253, 0, __PYX_ERR(1, 1253, __pyx_L1_error));
21989 
21990  /* "View.MemoryView":1256
21991  * Py_ssize_t extent2) except -1 with gil:
21992  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
21993  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
21994  *
21995  * @cname('__pyx_memoryview_err_dim')
21996  */
21997  __Pyx_TraceLine(1256,0,__PYX_ERR(1, 1256, __pyx_L1_error))
21998  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1256, __pyx_L1_error)
21999  __Pyx_GOTREF(__pyx_t_1);
22000  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1256, __pyx_L1_error)
22001  __Pyx_GOTREF(__pyx_t_2);
22002  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1256, __pyx_L1_error)
22003  __Pyx_GOTREF(__pyx_t_3);
22004  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1256, __pyx_L1_error)
22005  __Pyx_GOTREF(__pyx_t_4);
22006  __Pyx_GIVEREF(__pyx_t_1);
22007  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
22008  __Pyx_GIVEREF(__pyx_t_2);
22009  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
22010  __Pyx_GIVEREF(__pyx_t_3);
22011  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
22012  __pyx_t_1 = 0;
22013  __pyx_t_2 = 0;
22014  __pyx_t_3 = 0;
22015 
22016  /* "View.MemoryView":1255
22017  * cdef int _err_extents(int i, Py_ssize_t extent1,
22018  * Py_ssize_t extent2) except -1 with gil:
22019  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
22020  * (i, extent1, extent2))
22021  *
22022  */
22023  __Pyx_TraceLine(1255,0,__PYX_ERR(1, 1255, __pyx_L1_error))
22024  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1255, __pyx_L1_error)
22025  __Pyx_GOTREF(__pyx_t_3);
22026  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22027  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1255, __pyx_L1_error)
22028  __Pyx_GOTREF(__pyx_t_4);
22029  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22030  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22031  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22032  __PYX_ERR(1, 1255, __pyx_L1_error)
22033 
22034  /* "View.MemoryView":1253
22035  *
22036  * @cname('__pyx_memoryview_err_extents')
22037  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
22038  * Py_ssize_t extent2) except -1 with gil:
22039  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
22040  */
22041 
22042  /* function exit code */
22043  __pyx_L1_error:;
22044  __Pyx_XDECREF(__pyx_t_1);
22045  __Pyx_XDECREF(__pyx_t_2);
22046  __Pyx_XDECREF(__pyx_t_3);
22047  __Pyx_XDECREF(__pyx_t_4);
22048  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
22049  __pyx_r = -1;
22050  __Pyx_TraceReturn(Py_None, 0);
22051  __Pyx_RefNannyFinishContext();
22052  #ifdef WITH_THREAD
22053  __Pyx_PyGILState_Release(__pyx_gilstate_save);
22054  #endif
22055  return __pyx_r;
22056 }
22057 
22058 /* "View.MemoryView":1259
22059  *
22060  * @cname('__pyx_memoryview_err_dim')
22061  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
22062  * raise error(msg.decode('ascii') % dim)
22063  *
22064  */
22065 
22066 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
22067  int __pyx_r;
22068  __Pyx_TraceDeclarations
22069  __Pyx_RefNannyDeclarations
22070  PyObject *__pyx_t_1 = NULL;
22071  PyObject *__pyx_t_2 = NULL;
22072  PyObject *__pyx_t_3 = NULL;
22073  PyObject *__pyx_t_4 = NULL;
22074  int __pyx_lineno = 0;
22075  const char *__pyx_filename = NULL;
22076  int __pyx_clineno = 0;
22077  #ifdef WITH_THREAD
22078  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22079  #endif
22080  __Pyx_RefNannySetupContext("_err_dim", 0);
22081  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1259, 0, __PYX_ERR(1, 1259, __pyx_L1_error));
22082  __Pyx_INCREF(__pyx_v_error);
22083 
22084  /* "View.MemoryView":1260
22085  * @cname('__pyx_memoryview_err_dim')
22086  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
22087  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
22088  *
22089  * @cname('__pyx_memoryview_err')
22090  */
22091  __Pyx_TraceLine(1260,0,__PYX_ERR(1, 1260, __pyx_L1_error))
22092  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1260, __pyx_L1_error)
22093  __Pyx_GOTREF(__pyx_t_2);
22094  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1260, __pyx_L1_error)
22095  __Pyx_GOTREF(__pyx_t_3);
22096  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1260, __pyx_L1_error)
22097  __Pyx_GOTREF(__pyx_t_4);
22098  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22099  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22100  __Pyx_INCREF(__pyx_v_error);
22101  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
22102  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
22103  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
22104  if (likely(__pyx_t_2)) {
22105  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22106  __Pyx_INCREF(__pyx_t_2);
22107  __Pyx_INCREF(function);
22108  __Pyx_DECREF_SET(__pyx_t_3, function);
22109  }
22110  }
22111  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
22112  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22113  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22114  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1260, __pyx_L1_error)
22115  __Pyx_GOTREF(__pyx_t_1);
22116  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22117  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
22118  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22119  __PYX_ERR(1, 1260, __pyx_L1_error)
22120 
22121  /* "View.MemoryView":1259
22122  *
22123  * @cname('__pyx_memoryview_err_dim')
22124  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
22125  * raise error(msg.decode('ascii') % dim)
22126  *
22127  */
22128 
22129  /* function exit code */
22130  __pyx_L1_error:;
22131  __Pyx_XDECREF(__pyx_t_1);
22132  __Pyx_XDECREF(__pyx_t_2);
22133  __Pyx_XDECREF(__pyx_t_3);
22134  __Pyx_XDECREF(__pyx_t_4);
22135  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
22136  __pyx_r = -1;
22137  __Pyx_XDECREF(__pyx_v_error);
22138  __Pyx_TraceReturn(Py_None, 0);
22139  __Pyx_RefNannyFinishContext();
22140  #ifdef WITH_THREAD
22141  __Pyx_PyGILState_Release(__pyx_gilstate_save);
22142  #endif
22143  return __pyx_r;
22144 }
22145 
22146 /* "View.MemoryView":1263
22147  *
22148  * @cname('__pyx_memoryview_err')
22149  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
22150  * if msg != NULL:
22151  * raise error(msg.decode('ascii'))
22152  */
22153 
22154 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
22155  int __pyx_r;
22156  __Pyx_TraceDeclarations
22157  __Pyx_RefNannyDeclarations
22158  int __pyx_t_1;
22159  PyObject *__pyx_t_2 = NULL;
22160  PyObject *__pyx_t_3 = NULL;
22161  PyObject *__pyx_t_4 = NULL;
22162  PyObject *__pyx_t_5 = NULL;
22163  int __pyx_lineno = 0;
22164  const char *__pyx_filename = NULL;
22165  int __pyx_clineno = 0;
22166  #ifdef WITH_THREAD
22167  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22168  #endif
22169  __Pyx_RefNannySetupContext("_err", 0);
22170  __Pyx_TraceCall("_err", __pyx_f[1], 1263, 0, __PYX_ERR(1, 1263, __pyx_L1_error));
22171  __Pyx_INCREF(__pyx_v_error);
22172 
22173  /* "View.MemoryView":1264
22174  * @cname('__pyx_memoryview_err')
22175  * cdef int _err(object error, char *msg) except -1 with gil:
22176  * if msg != NULL: # <<<<<<<<<<<<<<
22177  * raise error(msg.decode('ascii'))
22178  * else:
22179  */
22180  __Pyx_TraceLine(1264,0,__PYX_ERR(1, 1264, __pyx_L1_error))
22181  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
22182  if (unlikely(__pyx_t_1)) {
22183 
22184  /* "View.MemoryView":1265
22185  * cdef int _err(object error, char *msg) except -1 with gil:
22186  * if msg != NULL:
22187  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
22188  * else:
22189  * raise error
22190  */
22191  __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
22192  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1265, __pyx_L1_error)
22193  __Pyx_GOTREF(__pyx_t_3);
22194  __Pyx_INCREF(__pyx_v_error);
22195  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
22196  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
22197  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
22198  if (likely(__pyx_t_5)) {
22199  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22200  __Pyx_INCREF(__pyx_t_5);
22201  __Pyx_INCREF(function);
22202  __Pyx_DECREF_SET(__pyx_t_4, function);
22203  }
22204  }
22205  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
22206  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22207  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22208  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1265, __pyx_L1_error)
22209  __Pyx_GOTREF(__pyx_t_2);
22210  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22211  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
22212  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22213  __PYX_ERR(1, 1265, __pyx_L1_error)
22214 
22215  /* "View.MemoryView":1264
22216  * @cname('__pyx_memoryview_err')
22217  * cdef int _err(object error, char *msg) except -1 with gil:
22218  * if msg != NULL: # <<<<<<<<<<<<<<
22219  * raise error(msg.decode('ascii'))
22220  * else:
22221  */
22222  }
22223 
22224  /* "View.MemoryView":1267
22225  * raise error(msg.decode('ascii'))
22226  * else:
22227  * raise error # <<<<<<<<<<<<<<
22228  *
22229  * @cname('__pyx_memoryview_copy_contents')
22230  */
22231  __Pyx_TraceLine(1267,0,__PYX_ERR(1, 1267, __pyx_L1_error))
22232  /*else*/ {
22233  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
22234  __PYX_ERR(1, 1267, __pyx_L1_error)
22235  }
22236 
22237  /* "View.MemoryView":1263
22238  *
22239  * @cname('__pyx_memoryview_err')
22240  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
22241  * if msg != NULL:
22242  * raise error(msg.decode('ascii'))
22243  */
22244 
22245  /* function exit code */
22246  __pyx_L1_error:;
22247  __Pyx_XDECREF(__pyx_t_2);
22248  __Pyx_XDECREF(__pyx_t_3);
22249  __Pyx_XDECREF(__pyx_t_4);
22250  __Pyx_XDECREF(__pyx_t_5);
22251  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
22252  __pyx_r = -1;
22253  __Pyx_XDECREF(__pyx_v_error);
22254  __Pyx_TraceReturn(Py_None, 0);
22255  __Pyx_RefNannyFinishContext();
22256  #ifdef WITH_THREAD
22257  __Pyx_PyGILState_Release(__pyx_gilstate_save);
22258  #endif
22259  return __pyx_r;
22260 }
22261 
22262 /* "View.MemoryView":1270
22263  *
22264  * @cname('__pyx_memoryview_copy_contents')
22265  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
22266  * __Pyx_memviewslice dst,
22267  * int src_ndim, int dst_ndim,
22268  */
22269 
22270 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
22271  void *__pyx_v_tmpdata;
22272  size_t __pyx_v_itemsize;
22273  int __pyx_v_i;
22274  char __pyx_v_order;
22275  int __pyx_v_broadcasting;
22276  int __pyx_v_direct_copy;
22277  __Pyx_memviewslice __pyx_v_tmp;
22278  int __pyx_v_ndim;
22279  int __pyx_r;
22280  __Pyx_TraceDeclarations
22281  Py_ssize_t __pyx_t_1;
22282  int __pyx_t_2;
22283  int __pyx_t_3;
22284  int __pyx_t_4;
22285  int __pyx_t_5;
22286  int __pyx_t_6;
22287  void *__pyx_t_7;
22288  int __pyx_t_8;
22289  int __pyx_lineno = 0;
22290  const char *__pyx_filename = NULL;
22291  int __pyx_clineno = 0;
22292  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1270, 1, __PYX_ERR(1, 1270, __pyx_L1_error));
22293 
22294  /* "View.MemoryView":1278
22295  * Check for overlapping memory and verify the shapes.
22296  * """
22297  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
22298  * cdef size_t itemsize = src.memview.view.itemsize
22299  * cdef int i
22300  */
22301  __Pyx_TraceLine(1278,1,__PYX_ERR(1, 1278, __pyx_L1_error))
22302  __pyx_v_tmpdata = NULL;
22303 
22304  /* "View.MemoryView":1279
22305  * """
22306  * cdef void *tmpdata = NULL
22307  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
22308  * cdef int i
22309  * cdef char order = get_best_order(&src, src_ndim)
22310  */
22311  __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
22312  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
22313  __pyx_v_itemsize = __pyx_t_1;
22314 
22315  /* "View.MemoryView":1281
22316  * cdef size_t itemsize = src.memview.view.itemsize
22317  * cdef int i
22318  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
22319  * cdef bint broadcasting = False
22320  * cdef bint direct_copy = False
22321  */
22322  __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
22323  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
22324 
22325  /* "View.MemoryView":1282
22326  * cdef int i
22327  * cdef char order = get_best_order(&src, src_ndim)
22328  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
22329  * cdef bint direct_copy = False
22330  * cdef __Pyx_memviewslice tmp
22331  */
22332  __Pyx_TraceLine(1282,1,__PYX_ERR(1, 1282, __pyx_L1_error))
22333  __pyx_v_broadcasting = 0;
22334 
22335  /* "View.MemoryView":1283
22336  * cdef char order = get_best_order(&src, src_ndim)
22337  * cdef bint broadcasting = False
22338  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
22339  * cdef __Pyx_memviewslice tmp
22340  *
22341  */
22342  __Pyx_TraceLine(1283,1,__PYX_ERR(1, 1283, __pyx_L1_error))
22343  __pyx_v_direct_copy = 0;
22344 
22345  /* "View.MemoryView":1286
22346  * cdef __Pyx_memviewslice tmp
22347  *
22348  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
22349  * broadcast_leading(&src, src_ndim, dst_ndim)
22350  * elif dst_ndim < src_ndim:
22351  */
22352  __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
22353  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
22354  if (__pyx_t_2) {
22355 
22356  /* "View.MemoryView":1287
22357  *
22358  * if src_ndim < dst_ndim:
22359  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
22360  * elif dst_ndim < src_ndim:
22361  * broadcast_leading(&dst, dst_ndim, src_ndim)
22362  */
22363  __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
22364  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
22365 
22366  /* "View.MemoryView":1286
22367  * cdef __Pyx_memviewslice tmp
22368  *
22369  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
22370  * broadcast_leading(&src, src_ndim, dst_ndim)
22371  * elif dst_ndim < src_ndim:
22372  */
22373  goto __pyx_L3;
22374  }
22375 
22376  /* "View.MemoryView":1288
22377  * if src_ndim < dst_ndim:
22378  * broadcast_leading(&src, src_ndim, dst_ndim)
22379  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
22380  * broadcast_leading(&dst, dst_ndim, src_ndim)
22381  *
22382  */
22383  __Pyx_TraceLine(1288,1,__PYX_ERR(1, 1288, __pyx_L1_error))
22384  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
22385  if (__pyx_t_2) {
22386 
22387  /* "View.MemoryView":1289
22388  * broadcast_leading(&src, src_ndim, dst_ndim)
22389  * elif dst_ndim < src_ndim:
22390  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
22391  *
22392  * cdef int ndim = max(src_ndim, dst_ndim)
22393  */
22394  __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
22395  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
22396 
22397  /* "View.MemoryView":1288
22398  * if src_ndim < dst_ndim:
22399  * broadcast_leading(&src, src_ndim, dst_ndim)
22400  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
22401  * broadcast_leading(&dst, dst_ndim, src_ndim)
22402  *
22403  */
22404  }
22405  __pyx_L3:;
22406 
22407  /* "View.MemoryView":1291
22408  * broadcast_leading(&dst, dst_ndim, src_ndim)
22409  *
22410  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
22411  *
22412  * for i in range(ndim):
22413  */
22414  __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
22415  __pyx_t_3 = __pyx_v_dst_ndim;
22416  __pyx_t_4 = __pyx_v_src_ndim;
22417  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
22418  __pyx_t_5 = __pyx_t_3;
22419  } else {
22420  __pyx_t_5 = __pyx_t_4;
22421  }
22422  __pyx_v_ndim = __pyx_t_5;
22423 
22424  /* "View.MemoryView":1293
22425  * cdef int ndim = max(src_ndim, dst_ndim)
22426  *
22427  * for i in range(ndim): # <<<<<<<<<<<<<<
22428  * if src.shape[i] != dst.shape[i]:
22429  * if src.shape[i] == 1:
22430  */
22431  __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
22432  __pyx_t_5 = __pyx_v_ndim;
22433  __pyx_t_3 = __pyx_t_5;
22434  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
22435  __pyx_v_i = __pyx_t_4;
22436 
22437  /* "View.MemoryView":1294
22438  *
22439  * for i in range(ndim):
22440  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
22441  * if src.shape[i] == 1:
22442  * broadcasting = True
22443  */
22444  __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
22445  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
22446  if (__pyx_t_2) {
22447 
22448  /* "View.MemoryView":1295
22449  * for i in range(ndim):
22450  * if src.shape[i] != dst.shape[i]:
22451  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
22452  * broadcasting = True
22453  * src.strides[i] = 0
22454  */
22455  __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
22456  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
22457  if (__pyx_t_2) {
22458 
22459  /* "View.MemoryView":1296
22460  * if src.shape[i] != dst.shape[i]:
22461  * if src.shape[i] == 1:
22462  * broadcasting = True # <<<<<<<<<<<<<<
22463  * src.strides[i] = 0
22464  * else:
22465  */
22466  __Pyx_TraceLine(1296,1,__PYX_ERR(1, 1296, __pyx_L1_error))
22467  __pyx_v_broadcasting = 1;
22468 
22469  /* "View.MemoryView":1297
22470  * if src.shape[i] == 1:
22471  * broadcasting = True
22472  * src.strides[i] = 0 # <<<<<<<<<<<<<<
22473  * else:
22474  * _err_extents(i, dst.shape[i], src.shape[i])
22475  */
22476  __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
22477  (__pyx_v_src.strides[__pyx_v_i]) = 0;
22478 
22479  /* "View.MemoryView":1295
22480  * for i in range(ndim):
22481  * if src.shape[i] != dst.shape[i]:
22482  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
22483  * broadcasting = True
22484  * src.strides[i] = 0
22485  */
22486  goto __pyx_L7;
22487  }
22488 
22489  /* "View.MemoryView":1299
22490  * src.strides[i] = 0
22491  * else:
22492  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
22493  *
22494  * if src.suboffsets[i] >= 0:
22495  */
22496  __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
22497  /*else*/ {
22498  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1299, __pyx_L1_error)
22499  }
22500  __pyx_L7:;
22501 
22502  /* "View.MemoryView":1294
22503  *
22504  * for i in range(ndim):
22505  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
22506  * if src.shape[i] == 1:
22507  * broadcasting = True
22508  */
22509  }
22510 
22511  /* "View.MemoryView":1301
22512  * _err_extents(i, dst.shape[i], src.shape[i])
22513  *
22514  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
22515  * _err_dim(ValueError, "Dimension %d is not direct", i)
22516  *
22517  */
22518  __Pyx_TraceLine(1301,1,__PYX_ERR(1, 1301, __pyx_L1_error))
22519  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
22520  if (__pyx_t_2) {
22521 
22522  /* "View.MemoryView":1302
22523  *
22524  * if src.suboffsets[i] >= 0:
22525  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
22526  *
22527  * if slices_overlap(&src, &dst, ndim, itemsize):
22528  */
22529  __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
22530  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1302, __pyx_L1_error)
22531 
22532  /* "View.MemoryView":1301
22533  * _err_extents(i, dst.shape[i], src.shape[i])
22534  *
22535  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
22536  * _err_dim(ValueError, "Dimension %d is not direct", i)
22537  *
22538  */
22539  }
22540  }
22541 
22542  /* "View.MemoryView":1304
22543  * _err_dim(ValueError, "Dimension %d is not direct", i)
22544  *
22545  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
22546  *
22547  * if not slice_is_contig(src, order, ndim):
22548  */
22549  __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
22550  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
22551  if (__pyx_t_2) {
22552 
22553  /* "View.MemoryView":1306
22554  * if slices_overlap(&src, &dst, ndim, itemsize):
22555  *
22556  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
22557  * order = get_best_order(&dst, ndim)
22558  *
22559  */
22560  __Pyx_TraceLine(1306,1,__PYX_ERR(1, 1306, __pyx_L1_error))
22561  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
22562  if (__pyx_t_2) {
22563 
22564  /* "View.MemoryView":1307
22565  *
22566  * if not slice_is_contig(src, order, ndim):
22567  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
22568  *
22569  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
22570  */
22571  __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
22572  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
22573 
22574  /* "View.MemoryView":1306
22575  * if slices_overlap(&src, &dst, ndim, itemsize):
22576  *
22577  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
22578  * order = get_best_order(&dst, ndim)
22579  *
22580  */
22581  }
22582 
22583  /* "View.MemoryView":1309
22584  * order = get_best_order(&dst, ndim)
22585  *
22586  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
22587  * src = tmp
22588  *
22589  */
22590  __Pyx_TraceLine(1309,1,__PYX_ERR(1, 1309, __pyx_L1_error))
22591  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1309, __pyx_L1_error)
22592  __pyx_v_tmpdata = __pyx_t_7;
22593 
22594  /* "View.MemoryView":1310
22595  *
22596  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
22597  * src = tmp # <<<<<<<<<<<<<<
22598  *
22599  * if not broadcasting:
22600  */
22601  __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
22602  __pyx_v_src = __pyx_v_tmp;
22603 
22604  /* "View.MemoryView":1304
22605  * _err_dim(ValueError, "Dimension %d is not direct", i)
22606  *
22607  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
22608  *
22609  * if not slice_is_contig(src, order, ndim):
22610  */
22611  }
22612 
22613  /* "View.MemoryView":1312
22614  * src = tmp
22615  *
22616  * if not broadcasting: # <<<<<<<<<<<<<<
22617  *
22618  *
22619  */
22620  __Pyx_TraceLine(1312,1,__PYX_ERR(1, 1312, __pyx_L1_error))
22621  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
22622  if (__pyx_t_2) {
22623 
22624  /* "View.MemoryView":1315
22625  *
22626  *
22627  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
22628  * direct_copy = slice_is_contig(dst, 'C', ndim)
22629  * elif slice_is_contig(src, 'F', ndim):
22630  */
22631  __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
22632  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
22633  if (__pyx_t_2) {
22634 
22635  /* "View.MemoryView":1316
22636  *
22637  * if slice_is_contig(src, 'C', ndim):
22638  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
22639  * elif slice_is_contig(src, 'F', ndim):
22640  * direct_copy = slice_is_contig(dst, 'F', ndim)
22641  */
22642  __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
22643  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
22644 
22645  /* "View.MemoryView":1315
22646  *
22647  *
22648  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
22649  * direct_copy = slice_is_contig(dst, 'C', ndim)
22650  * elif slice_is_contig(src, 'F', ndim):
22651  */
22652  goto __pyx_L12;
22653  }
22654 
22655  /* "View.MemoryView":1317
22656  * if slice_is_contig(src, 'C', ndim):
22657  * direct_copy = slice_is_contig(dst, 'C', ndim)
22658  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
22659  * direct_copy = slice_is_contig(dst, 'F', ndim)
22660  *
22661  */
22662  __Pyx_TraceLine(1317,1,__PYX_ERR(1, 1317, __pyx_L1_error))
22663  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
22664  if (__pyx_t_2) {
22665 
22666  /* "View.MemoryView":1318
22667  * direct_copy = slice_is_contig(dst, 'C', ndim)
22668  * elif slice_is_contig(src, 'F', ndim):
22669  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
22670  *
22671  * if direct_copy:
22672  */
22673  __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
22674  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
22675 
22676  /* "View.MemoryView":1317
22677  * if slice_is_contig(src, 'C', ndim):
22678  * direct_copy = slice_is_contig(dst, 'C', ndim)
22679  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
22680  * direct_copy = slice_is_contig(dst, 'F', ndim)
22681  *
22682  */
22683  }
22684  __pyx_L12:;
22685 
22686  /* "View.MemoryView":1320
22687  * direct_copy = slice_is_contig(dst, 'F', ndim)
22688  *
22689  * if direct_copy: # <<<<<<<<<<<<<<
22690  *
22691  * refcount_copying(&dst, dtype_is_object, ndim, False)
22692  */
22693  __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
22694  __pyx_t_2 = (__pyx_v_direct_copy != 0);
22695  if (__pyx_t_2) {
22696 
22697  /* "View.MemoryView":1322
22698  * if direct_copy:
22699  *
22700  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
22701  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
22702  * refcount_copying(&dst, dtype_is_object, ndim, True)
22703  */
22704  __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
22705  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
22706 
22707  /* "View.MemoryView":1323
22708  *
22709  * refcount_copying(&dst, dtype_is_object, ndim, False)
22710  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
22711  * refcount_copying(&dst, dtype_is_object, ndim, True)
22712  * free(tmpdata)
22713  */
22714  __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
22715  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
22716 
22717  /* "View.MemoryView":1324
22718  * refcount_copying(&dst, dtype_is_object, ndim, False)
22719  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
22720  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
22721  * free(tmpdata)
22722  * return 0
22723  */
22724  __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
22725  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
22726 
22727  /* "View.MemoryView":1325
22728  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
22729  * refcount_copying(&dst, dtype_is_object, ndim, True)
22730  * free(tmpdata) # <<<<<<<<<<<<<<
22731  * return 0
22732  *
22733  */
22734  __Pyx_TraceLine(1325,1,__PYX_ERR(1, 1325, __pyx_L1_error))
22735  free(__pyx_v_tmpdata);
22736 
22737  /* "View.MemoryView":1326
22738  * refcount_copying(&dst, dtype_is_object, ndim, True)
22739  * free(tmpdata)
22740  * return 0 # <<<<<<<<<<<<<<
22741  *
22742  * if order == 'F' == get_best_order(&dst, ndim):
22743  */
22744  __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
22745  __pyx_r = 0;
22746  goto __pyx_L0;
22747 
22748  /* "View.MemoryView":1320
22749  * direct_copy = slice_is_contig(dst, 'F', ndim)
22750  *
22751  * if direct_copy: # <<<<<<<<<<<<<<
22752  *
22753  * refcount_copying(&dst, dtype_is_object, ndim, False)
22754  */
22755  }
22756 
22757  /* "View.MemoryView":1312
22758  * src = tmp
22759  *
22760  * if not broadcasting: # <<<<<<<<<<<<<<
22761  *
22762  *
22763  */
22764  }
22765 
22766  /* "View.MemoryView":1328
22767  * return 0
22768  *
22769  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
22770  *
22771  *
22772  */
22773  __Pyx_TraceLine(1328,1,__PYX_ERR(1, 1328, __pyx_L1_error))
22774  __pyx_t_2 = (__pyx_v_order == 'F');
22775  if (__pyx_t_2) {
22776  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
22777  }
22778  __pyx_t_8 = (__pyx_t_2 != 0);
22779  if (__pyx_t_8) {
22780 
22781  /* "View.MemoryView":1331
22782  *
22783  *
22784  * transpose_memslice(&src) # <<<<<<<<<<<<<<
22785  * transpose_memslice(&dst)
22786  *
22787  */
22788  __Pyx_TraceLine(1331,1,__PYX_ERR(1, 1331, __pyx_L1_error))
22789  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1331, __pyx_L1_error)
22790 
22791  /* "View.MemoryView":1332
22792  *
22793  * transpose_memslice(&src)
22794  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
22795  *
22796  * refcount_copying(&dst, dtype_is_object, ndim, False)
22797  */
22798  __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
22799  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1332, __pyx_L1_error)
22800 
22801  /* "View.MemoryView":1328
22802  * return 0
22803  *
22804  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
22805  *
22806  *
22807  */
22808  }
22809 
22810  /* "View.MemoryView":1334
22811  * transpose_memslice(&dst)
22812  *
22813  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
22814  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
22815  * refcount_copying(&dst, dtype_is_object, ndim, True)
22816  */
22817  __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
22818  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
22819 
22820  /* "View.MemoryView":1335
22821  *
22822  * refcount_copying(&dst, dtype_is_object, ndim, False)
22823  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
22824  * refcount_copying(&dst, dtype_is_object, ndim, True)
22825  *
22826  */
22827  __Pyx_TraceLine(1335,1,__PYX_ERR(1, 1335, __pyx_L1_error))
22828  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
22829 
22830  /* "View.MemoryView":1336
22831  * refcount_copying(&dst, dtype_is_object, ndim, False)
22832  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
22833  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
22834  *
22835  * free(tmpdata)
22836  */
22837  __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
22838  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
22839 
22840  /* "View.MemoryView":1338
22841  * refcount_copying(&dst, dtype_is_object, ndim, True)
22842  *
22843  * free(tmpdata) # <<<<<<<<<<<<<<
22844  * return 0
22845  *
22846  */
22847  __Pyx_TraceLine(1338,1,__PYX_ERR(1, 1338, __pyx_L1_error))
22848  free(__pyx_v_tmpdata);
22849 
22850  /* "View.MemoryView":1339
22851  *
22852  * free(tmpdata)
22853  * return 0 # <<<<<<<<<<<<<<
22854  *
22855  * @cname('__pyx_memoryview_broadcast_leading')
22856  */
22857  __Pyx_TraceLine(1339,1,__PYX_ERR(1, 1339, __pyx_L1_error))
22858  __pyx_r = 0;
22859  goto __pyx_L0;
22860 
22861  /* "View.MemoryView":1270
22862  *
22863  * @cname('__pyx_memoryview_copy_contents')
22864  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
22865  * __Pyx_memviewslice dst,
22866  * int src_ndim, int dst_ndim,
22867  */
22868 
22869  /* function exit code */
22870  __pyx_L1_error:;
22871  {
22872  #ifdef WITH_THREAD
22873  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22874  #endif
22875  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
22876  #ifdef WITH_THREAD
22877  __Pyx_PyGILState_Release(__pyx_gilstate_save);
22878  #endif
22879  }
22880  __pyx_r = -1;
22881  __pyx_L0:;
22882  __Pyx_TraceReturn(Py_None, 1);
22883  return __pyx_r;
22884 }
22885 
22886 /* "View.MemoryView":1342
22887  *
22888  * @cname('__pyx_memoryview_broadcast_leading')
22889  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
22890  * int ndim,
22891  * int ndim_other) nogil:
22892  */
22893 
22894 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
22895  int __pyx_v_i;
22896  int __pyx_v_offset;
22897  __Pyx_TraceDeclarations
22898  int __pyx_t_1;
22899  int __pyx_t_2;
22900  int __pyx_t_3;
22901  int __pyx_lineno = 0;
22902  const char *__pyx_filename = NULL;
22903  int __pyx_clineno = 0;
22904  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1342, 1, __PYX_ERR(1, 1342, __pyx_L1_error));
22905 
22906  /* "View.MemoryView":1346
22907  * int ndim_other) nogil:
22908  * cdef int i
22909  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
22910  *
22911  * for i in range(ndim - 1, -1, -1):
22912  */
22913  __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
22914  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
22915 
22916  /* "View.MemoryView":1348
22917  * cdef int offset = ndim_other - ndim
22918  *
22919  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
22920  * mslice.shape[i + offset] = mslice.shape[i]
22921  * mslice.strides[i + offset] = mslice.strides[i]
22922  */
22923  __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
22924  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
22925  __pyx_v_i = __pyx_t_1;
22926 
22927  /* "View.MemoryView":1349
22928  *
22929  * for i in range(ndim - 1, -1, -1):
22930  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
22931  * mslice.strides[i + offset] = mslice.strides[i]
22932  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
22933  */
22934  __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
22935  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
22936 
22937  /* "View.MemoryView":1350
22938  * for i in range(ndim - 1, -1, -1):
22939  * mslice.shape[i + offset] = mslice.shape[i]
22940  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
22941  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
22942  *
22943  */
22944  __Pyx_TraceLine(1350,1,__PYX_ERR(1, 1350, __pyx_L1_error))
22945  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
22946 
22947  /* "View.MemoryView":1351
22948  * mslice.shape[i + offset] = mslice.shape[i]
22949  * mslice.strides[i + offset] = mslice.strides[i]
22950  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
22951  *
22952  * for i in range(offset):
22953  */
22954  __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
22955  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
22956  }
22957 
22958  /* "View.MemoryView":1353
22959  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
22960  *
22961  * for i in range(offset): # <<<<<<<<<<<<<<
22962  * mslice.shape[i] = 1
22963  * mslice.strides[i] = mslice.strides[0]
22964  */
22965  __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
22966  __pyx_t_1 = __pyx_v_offset;
22967  __pyx_t_2 = __pyx_t_1;
22968  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
22969  __pyx_v_i = __pyx_t_3;
22970 
22971  /* "View.MemoryView":1354
22972  *
22973  * for i in range(offset):
22974  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
22975  * mslice.strides[i] = mslice.strides[0]
22976  * mslice.suboffsets[i] = -1
22977  */
22978  __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
22979  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
22980 
22981  /* "View.MemoryView":1355
22982  * for i in range(offset):
22983  * mslice.shape[i] = 1
22984  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
22985  * mslice.suboffsets[i] = -1
22986  *
22987  */
22988  __Pyx_TraceLine(1355,1,__PYX_ERR(1, 1355, __pyx_L1_error))
22989  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
22990 
22991  /* "View.MemoryView":1356
22992  * mslice.shape[i] = 1
22993  * mslice.strides[i] = mslice.strides[0]
22994  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
22995  *
22996  *
22997  */
22998  __Pyx_TraceLine(1356,1,__PYX_ERR(1, 1356, __pyx_L1_error))
22999  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
23000  }
23001 
23002  /* "View.MemoryView":1342
23003  *
23004  * @cname('__pyx_memoryview_broadcast_leading')
23005  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
23006  * int ndim,
23007  * int ndim_other) nogil:
23008  */
23009 
23010  /* function exit code */
23011  goto __pyx_L0;
23012  __pyx_L1_error:;
23013  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23014  __pyx_L0:;
23015  __Pyx_TraceReturn(Py_None, 1);
23016 }
23017 
23018 /* "View.MemoryView":1364
23019  *
23020  * @cname('__pyx_memoryview_refcount_copying')
23021  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
23022  * int ndim, bint inc) nogil:
23023  *
23024  */
23025 
23026 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
23027  __Pyx_TraceDeclarations
23028  int __pyx_t_1;
23029  int __pyx_lineno = 0;
23030  const char *__pyx_filename = NULL;
23031  int __pyx_clineno = 0;
23032  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1364, 1, __PYX_ERR(1, 1364, __pyx_L1_error));
23033 
23034  /* "View.MemoryView":1368
23035  *
23036  *
23037  * if dtype_is_object: # <<<<<<<<<<<<<<
23038  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
23039  * dst.strides, ndim, inc)
23040  */
23041  __Pyx_TraceLine(1368,1,__PYX_ERR(1, 1368, __pyx_L1_error))
23042  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
23043  if (__pyx_t_1) {
23044 
23045  /* "View.MemoryView":1369
23046  *
23047  * if dtype_is_object:
23048  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
23049  * dst.strides, ndim, inc)
23050  *
23051  */
23052  __Pyx_TraceLine(1369,1,__PYX_ERR(1, 1369, __pyx_L1_error))
23053  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
23054 
23055  /* "View.MemoryView":1368
23056  *
23057  *
23058  * if dtype_is_object: # <<<<<<<<<<<<<<
23059  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
23060  * dst.strides, ndim, inc)
23061  */
23062  }
23063 
23064  /* "View.MemoryView":1364
23065  *
23066  * @cname('__pyx_memoryview_refcount_copying')
23067  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
23068  * int ndim, bint inc) nogil:
23069  *
23070  */
23071 
23072  /* function exit code */
23073  goto __pyx_L0;
23074  __pyx_L1_error:;
23075  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23076  __pyx_L0:;
23077  __Pyx_TraceReturn(Py_None, 1);
23078 }
23079 
23080 /* "View.MemoryView":1373
23081  *
23082  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
23083  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23084  * Py_ssize_t *strides, int ndim,
23085  * bint inc) with gil:
23086  */
23087 
23088 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
23089  __Pyx_TraceDeclarations
23090  __Pyx_RefNannyDeclarations
23091  int __pyx_lineno = 0;
23092  const char *__pyx_filename = NULL;
23093  int __pyx_clineno = 0;
23094  #ifdef WITH_THREAD
23095  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
23096  #endif
23097  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
23098  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1373, 0, __PYX_ERR(1, 1373, __pyx_L1_error));
23099 
23100  /* "View.MemoryView":1376
23101  * Py_ssize_t *strides, int ndim,
23102  * bint inc) with gil:
23103  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
23104  *
23105  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23106  */
23107  __Pyx_TraceLine(1376,0,__PYX_ERR(1, 1376, __pyx_L1_error))
23108  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
23109 
23110  /* "View.MemoryView":1373
23111  *
23112  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
23113  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23114  * Py_ssize_t *strides, int ndim,
23115  * bint inc) with gil:
23116  */
23117 
23118  /* function exit code */
23119  goto __pyx_L0;
23120  __pyx_L1_error:;
23121  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
23122  __pyx_L0:;
23123  __Pyx_TraceReturn(Py_None, 0);
23124  __Pyx_RefNannyFinishContext();
23125  #ifdef WITH_THREAD
23126  __Pyx_PyGILState_Release(__pyx_gilstate_save);
23127  #endif
23128 }
23129 
23130 /* "View.MemoryView":1379
23131  *
23132  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23133  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23134  * Py_ssize_t *strides, int ndim, bint inc):
23135  * cdef Py_ssize_t i
23136  */
23137 
23138 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
23139  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
23140  __Pyx_TraceDeclarations
23141  __Pyx_RefNannyDeclarations
23142  Py_ssize_t __pyx_t_1;
23143  Py_ssize_t __pyx_t_2;
23144  Py_ssize_t __pyx_t_3;
23145  int __pyx_t_4;
23146  int __pyx_lineno = 0;
23147  const char *__pyx_filename = NULL;
23148  int __pyx_clineno = 0;
23149  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
23150  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1379, 0, __PYX_ERR(1, 1379, __pyx_L1_error));
23151 
23152  /* "View.MemoryView":1383
23153  * cdef Py_ssize_t i
23154  *
23155  * for i in range(shape[0]): # <<<<<<<<<<<<<<
23156  * if ndim == 1:
23157  * if inc:
23158  */
23159  __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
23160  __pyx_t_1 = (__pyx_v_shape[0]);
23161  __pyx_t_2 = __pyx_t_1;
23162  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
23163  __pyx_v_i = __pyx_t_3;
23164 
23165  /* "View.MemoryView":1384
23166  *
23167  * for i in range(shape[0]):
23168  * if ndim == 1: # <<<<<<<<<<<<<<
23169  * if inc:
23170  * Py_INCREF((<PyObject **> data)[0])
23171  */
23172  __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
23173  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
23174  if (__pyx_t_4) {
23175 
23176  /* "View.MemoryView":1385
23177  * for i in range(shape[0]):
23178  * if ndim == 1:
23179  * if inc: # <<<<<<<<<<<<<<
23180  * Py_INCREF((<PyObject **> data)[0])
23181  * else:
23182  */
23183  __Pyx_TraceLine(1385,0,__PYX_ERR(1, 1385, __pyx_L1_error))
23184  __pyx_t_4 = (__pyx_v_inc != 0);
23185  if (__pyx_t_4) {
23186 
23187  /* "View.MemoryView":1386
23188  * if ndim == 1:
23189  * if inc:
23190  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
23191  * else:
23192  * Py_DECREF((<PyObject **> data)[0])
23193  */
23194  __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
23195  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
23196 
23197  /* "View.MemoryView":1385
23198  * for i in range(shape[0]):
23199  * if ndim == 1:
23200  * if inc: # <<<<<<<<<<<<<<
23201  * Py_INCREF((<PyObject **> data)[0])
23202  * else:
23203  */
23204  goto __pyx_L6;
23205  }
23206 
23207  /* "View.MemoryView":1388
23208  * Py_INCREF((<PyObject **> data)[0])
23209  * else:
23210  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
23211  * else:
23212  * refcount_objects_in_slice(data, shape + 1, strides + 1,
23213  */
23214  __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
23215  /*else*/ {
23216  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
23217  }
23218  __pyx_L6:;
23219 
23220  /* "View.MemoryView":1384
23221  *
23222  * for i in range(shape[0]):
23223  * if ndim == 1: # <<<<<<<<<<<<<<
23224  * if inc:
23225  * Py_INCREF((<PyObject **> data)[0])
23226  */
23227  goto __pyx_L5;
23228  }
23229 
23230  /* "View.MemoryView":1390
23231  * Py_DECREF((<PyObject **> data)[0])
23232  * else:
23233  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
23234  * ndim - 1, inc)
23235  *
23236  */
23237  __Pyx_TraceLine(1390,0,__PYX_ERR(1, 1390, __pyx_L1_error))
23238  /*else*/ {
23239 
23240  /* "View.MemoryView":1391
23241  * else:
23242  * refcount_objects_in_slice(data, shape + 1, strides + 1,
23243  * ndim - 1, inc) # <<<<<<<<<<<<<<
23244  *
23245  * data += strides[0]
23246  */
23247  __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
23248  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
23249  }
23250  __pyx_L5:;
23251 
23252  /* "View.MemoryView":1393
23253  * ndim - 1, inc)
23254  *
23255  * data += strides[0] # <<<<<<<<<<<<<<
23256  *
23257  *
23258  */
23259  __Pyx_TraceLine(1393,0,__PYX_ERR(1, 1393, __pyx_L1_error))
23260  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
23261  }
23262 
23263  /* "View.MemoryView":1379
23264  *
23265  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23266  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23267  * Py_ssize_t *strides, int ndim, bint inc):
23268  * cdef Py_ssize_t i
23269  */
23270 
23271  /* function exit code */
23272  goto __pyx_L0;
23273  __pyx_L1_error:;
23274  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
23275  __pyx_L0:;
23276  __Pyx_TraceReturn(Py_None, 0);
23277  __Pyx_RefNannyFinishContext();
23278 }
23279 
23280 /* "View.MemoryView":1399
23281  *
23282  * @cname('__pyx_memoryview_slice_assign_scalar')
23283  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
23284  * size_t itemsize, void *item,
23285  * bint dtype_is_object) nogil:
23286  */
23287 
23288 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
23289  __Pyx_TraceDeclarations
23290  int __pyx_lineno = 0;
23291  const char *__pyx_filename = NULL;
23292  int __pyx_clineno = 0;
23293  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1399, 1, __PYX_ERR(1, 1399, __pyx_L1_error));
23294 
23295  /* "View.MemoryView":1402
23296  * size_t itemsize, void *item,
23297  * bint dtype_is_object) nogil:
23298  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
23299  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
23300  * itemsize, item)
23301  */
23302  __Pyx_TraceLine(1402,1,__PYX_ERR(1, 1402, __pyx_L1_error))
23303  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
23304 
23305  /* "View.MemoryView":1403
23306  * bint dtype_is_object) nogil:
23307  * refcount_copying(dst, dtype_is_object, ndim, False)
23308  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
23309  * itemsize, item)
23310  * refcount_copying(dst, dtype_is_object, ndim, True)
23311  */
23312  __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
23313  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
23314 
23315  /* "View.MemoryView":1405
23316  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
23317  * itemsize, item)
23318  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
23319  *
23320  *
23321  */
23322  __Pyx_TraceLine(1405,1,__PYX_ERR(1, 1405, __pyx_L1_error))
23323  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
23324 
23325  /* "View.MemoryView":1399
23326  *
23327  * @cname('__pyx_memoryview_slice_assign_scalar')
23328  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
23329  * size_t itemsize, void *item,
23330  * bint dtype_is_object) nogil:
23331  */
23332 
23333  /* function exit code */
23334  goto __pyx_L0;
23335  __pyx_L1_error:;
23336  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23337  __pyx_L0:;
23338  __Pyx_TraceReturn(Py_None, 1);
23339 }
23340 
23341 /* "View.MemoryView":1409
23342  *
23343  * @cname('__pyx_memoryview__slice_assign_scalar')
23344  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23345  * Py_ssize_t *strides, int ndim,
23346  * size_t itemsize, void *item) nogil:
23347  */
23348 
23349 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
23350  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
23351  Py_ssize_t __pyx_v_stride;
23352  Py_ssize_t __pyx_v_extent;
23353  __Pyx_TraceDeclarations
23354  int __pyx_t_1;
23355  Py_ssize_t __pyx_t_2;
23356  Py_ssize_t __pyx_t_3;
23357  Py_ssize_t __pyx_t_4;
23358  int __pyx_lineno = 0;
23359  const char *__pyx_filename = NULL;
23360  int __pyx_clineno = 0;
23361  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1409, 1, __PYX_ERR(1, 1409, __pyx_L1_error));
23362 
23363  /* "View.MemoryView":1413
23364  * size_t itemsize, void *item) nogil:
23365  * cdef Py_ssize_t i
23366  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
23367  * cdef Py_ssize_t extent = shape[0]
23368  *
23369  */
23370  __Pyx_TraceLine(1413,1,__PYX_ERR(1, 1413, __pyx_L1_error))
23371  __pyx_v_stride = (__pyx_v_strides[0]);
23372 
23373  /* "View.MemoryView":1414
23374  * cdef Py_ssize_t i
23375  * cdef Py_ssize_t stride = strides[0]
23376  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
23377  *
23378  * if ndim == 1:
23379  */
23380  __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
23381  __pyx_v_extent = (__pyx_v_shape[0]);
23382 
23383  /* "View.MemoryView":1416
23384  * cdef Py_ssize_t extent = shape[0]
23385  *
23386  * if ndim == 1: # <<<<<<<<<<<<<<
23387  * for i in range(extent):
23388  * memcpy(data, item, itemsize)
23389  */
23390  __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
23391  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
23392  if (__pyx_t_1) {
23393 
23394  /* "View.MemoryView":1417
23395  *
23396  * if ndim == 1:
23397  * for i in range(extent): # <<<<<<<<<<<<<<
23398  * memcpy(data, item, itemsize)
23399  * data += stride
23400  */
23401  __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
23402  __pyx_t_2 = __pyx_v_extent;
23403  __pyx_t_3 = __pyx_t_2;
23404  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23405  __pyx_v_i = __pyx_t_4;
23406 
23407  /* "View.MemoryView":1418
23408  * if ndim == 1:
23409  * for i in range(extent):
23410  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
23411  * data += stride
23412  * else:
23413  */
23414  __Pyx_TraceLine(1418,1,__PYX_ERR(1, 1418, __pyx_L1_error))
23415  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
23416 
23417  /* "View.MemoryView":1419
23418  * for i in range(extent):
23419  * memcpy(data, item, itemsize)
23420  * data += stride # <<<<<<<<<<<<<<
23421  * else:
23422  * for i in range(extent):
23423  */
23424  __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
23425  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
23426  }
23427 
23428  /* "View.MemoryView":1416
23429  * cdef Py_ssize_t extent = shape[0]
23430  *
23431  * if ndim == 1: # <<<<<<<<<<<<<<
23432  * for i in range(extent):
23433  * memcpy(data, item, itemsize)
23434  */
23435  goto __pyx_L3;
23436  }
23437 
23438  /* "View.MemoryView":1421
23439  * data += stride
23440  * else:
23441  * for i in range(extent): # <<<<<<<<<<<<<<
23442  * _slice_assign_scalar(data, shape + 1, strides + 1,
23443  * ndim - 1, itemsize, item)
23444  */
23445  __Pyx_TraceLine(1421,1,__PYX_ERR(1, 1421, __pyx_L1_error))
23446  /*else*/ {
23447  __pyx_t_2 = __pyx_v_extent;
23448  __pyx_t_3 = __pyx_t_2;
23449  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
23450  __pyx_v_i = __pyx_t_4;
23451 
23452  /* "View.MemoryView":1422
23453  * else:
23454  * for i in range(extent):
23455  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
23456  * ndim - 1, itemsize, item)
23457  * data += stride
23458  */
23459  __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
23460  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
23461 
23462  /* "View.MemoryView":1424
23463  * _slice_assign_scalar(data, shape + 1, strides + 1,
23464  * ndim - 1, itemsize, item)
23465  * data += stride # <<<<<<<<<<<<<<
23466  *
23467  *
23468  */
23469  __Pyx_TraceLine(1424,1,__PYX_ERR(1, 1424, __pyx_L1_error))
23470  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
23471  }
23472  }
23473  __pyx_L3:;
23474 
23475  /* "View.MemoryView":1409
23476  *
23477  * @cname('__pyx_memoryview__slice_assign_scalar')
23478  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23479  * Py_ssize_t *strides, int ndim,
23480  * size_t itemsize, void *item) nogil:
23481  */
23482 
23483  /* function exit code */
23484  goto __pyx_L0;
23485  __pyx_L1_error:;
23486  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
23487  __pyx_L0:;
23488  __Pyx_TraceReturn(Py_None, 1);
23489 }
23490 
23491 /* "(tree fragment)":1
23492  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23493  * cdef object __pyx_PickleError
23494  * cdef object __pyx_result
23495  */
23496 
23497 /* Python wrapper */
23498 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23499 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
23500 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23501  PyObject *__pyx_v___pyx_type = 0;
23502  long __pyx_v___pyx_checksum;
23503  PyObject *__pyx_v___pyx_state = 0;
23504  int __pyx_lineno = 0;
23505  const char *__pyx_filename = NULL;
23506  int __pyx_clineno = 0;
23507  PyObject *__pyx_r = 0;
23508  __Pyx_RefNannyDeclarations
23509  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
23510  {
23511  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
23512  PyObject* values[3] = {0,0,0};
23513  if (unlikely(__pyx_kwds)) {
23514  Py_ssize_t kw_args;
23515  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23516  switch (pos_args) {
23517  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23518  CYTHON_FALLTHROUGH;
23519  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23520  CYTHON_FALLTHROUGH;
23521  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23522  CYTHON_FALLTHROUGH;
23523  case 0: break;
23524  default: goto __pyx_L5_argtuple_error;
23525  }
23526  kw_args = PyDict_Size(__pyx_kwds);
23527  switch (pos_args) {
23528  case 0:
23529  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
23530  else goto __pyx_L5_argtuple_error;
23531  CYTHON_FALLTHROUGH;
23532  case 1:
23533  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
23534  else {
23535  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
23536  }
23537  CYTHON_FALLTHROUGH;
23538  case 2:
23539  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
23540  else {
23541  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
23542  }
23543  }
23544  if (unlikely(kw_args > 0)) {
23545  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
23546  }
23547  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
23548  goto __pyx_L5_argtuple_error;
23549  } else {
23550  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23551  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23552  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
23553  }
23554  __pyx_v___pyx_type = values[0];
23555  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
23556  __pyx_v___pyx_state = values[2];
23557  }
23558  goto __pyx_L4_argument_unpacking_done;
23559  __pyx_L5_argtuple_error:;
23560  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
23561  __pyx_L3_error:;
23562  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
23563  __Pyx_RefNannyFinishContext();
23564  return NULL;
23565  __pyx_L4_argument_unpacking_done:;
23566  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
23567 
23568  /* function exit code */
23569  __Pyx_RefNannyFinishContext();
23570  return __pyx_r;
23571 }
23572 
23573 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
23574  PyObject *__pyx_v___pyx_PickleError = 0;
23575  PyObject *__pyx_v___pyx_result = 0;
23576  PyObject *__pyx_r = NULL;
23577  __Pyx_TraceDeclarations
23578  __Pyx_RefNannyDeclarations
23579  PyObject *__pyx_t_1 = NULL;
23580  int __pyx_t_2;
23581  int __pyx_t_3;
23582  PyObject *__pyx_t_4 = NULL;
23583  PyObject *__pyx_t_5 = NULL;
23584  PyObject *__pyx_t_6 = NULL;
23585  int __pyx_lineno = 0;
23586  const char *__pyx_filename = NULL;
23587  int __pyx_clineno = 0;
23588  __Pyx_TraceFrameInit(__pyx_codeobj__25)
23589  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
23590  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
23591 
23592  /* "(tree fragment)":4
23593  * cdef object __pyx_PickleError
23594  * cdef object __pyx_result
23595  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
23596  * from pickle import PickleError as __pyx_PickleError
23597  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
23598  */
23599  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
23600  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
23601  __Pyx_GOTREF(__pyx_t_1);
23602  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__26, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
23603  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23604  __pyx_t_3 = (__pyx_t_2 != 0);
23605  if (__pyx_t_3) {
23606 
23607  /* "(tree fragment)":5
23608  * cdef object __pyx_result
23609  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
23610  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
23611  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
23612  * __pyx_result = Enum.__new__(__pyx_type)
23613  */
23614  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
23615  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
23616  __Pyx_GOTREF(__pyx_t_1);
23617  __Pyx_INCREF(__pyx_n_s_PickleError);
23618  __Pyx_GIVEREF(__pyx_n_s_PickleError);
23619  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
23620  __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
23621  __Pyx_GOTREF(__pyx_t_4);
23622  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23623  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
23624  __Pyx_GOTREF(__pyx_t_1);
23625  __Pyx_INCREF(__pyx_t_1);
23626  __pyx_v___pyx_PickleError = __pyx_t_1;
23627  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23628  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23629 
23630  /* "(tree fragment)":6
23631  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995):
23632  * from pickle import PickleError as __pyx_PickleError
23633  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
23634  * __pyx_result = Enum.__new__(__pyx_type)
23635  * if __pyx_state is not None:
23636  */
23637  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
23638  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
23639  __Pyx_GOTREF(__pyx_t_1);
23640  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
23641  __Pyx_GOTREF(__pyx_t_5);
23642  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23643  __Pyx_INCREF(__pyx_v___pyx_PickleError);
23644  __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
23645  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
23646  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
23647  if (likely(__pyx_t_6)) {
23648  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23649  __Pyx_INCREF(__pyx_t_6);
23650  __Pyx_INCREF(function);
23651  __Pyx_DECREF_SET(__pyx_t_1, function);
23652  }
23653  }
23654  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
23655  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23656  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23657  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
23658  __Pyx_GOTREF(__pyx_t_4);
23659  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23660  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
23661  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23662  __PYX_ERR(1, 6, __pyx_L1_error)
23663 
23664  /* "(tree fragment)":4
23665  * cdef object __pyx_PickleError
23666  * cdef object __pyx_result
23667  * if __pyx_checksum not in (0xb068931, 0x82a3537, 0x6ae9995): # <<<<<<<<<<<<<<
23668  * from pickle import PickleError as __pyx_PickleError
23669  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
23670  */
23671  }
23672 
23673  /* "(tree fragment)":7
23674  * from pickle import PickleError as __pyx_PickleError
23675  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
23676  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
23677  * if __pyx_state is not None:
23678  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23679  */
23680  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
23681  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
23682  __Pyx_GOTREF(__pyx_t_1);
23683  __pyx_t_5 = NULL;
23684  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
23685  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
23686  if (likely(__pyx_t_5)) {
23687  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23688  __Pyx_INCREF(__pyx_t_5);
23689  __Pyx_INCREF(function);
23690  __Pyx_DECREF_SET(__pyx_t_1, function);
23691  }
23692  }
23693  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
23694  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
23695  if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
23696  __Pyx_GOTREF(__pyx_t_4);
23697  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23698  __pyx_v___pyx_result = __pyx_t_4;
23699  __pyx_t_4 = 0;
23700 
23701  /* "(tree fragment)":8
23702  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
23703  * __pyx_result = Enum.__new__(__pyx_type)
23704  * if __pyx_state is not None: # <<<<<<<<<<<<<<
23705  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23706  * return __pyx_result
23707  */
23708  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
23709  __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
23710  __pyx_t_2 = (__pyx_t_3 != 0);
23711  if (__pyx_t_2) {
23712 
23713  /* "(tree fragment)":9
23714  * __pyx_result = Enum.__new__(__pyx_type)
23715  * if __pyx_state is not None:
23716  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
23717  * return __pyx_result
23718  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
23719  */
23720  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
23721  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||((void)PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
23722  __pyx_t_4 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
23723  __Pyx_GOTREF(__pyx_t_4);
23724  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23725 
23726  /* "(tree fragment)":8
23727  * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xb068931, 0x82a3537, 0x6ae9995) = (name))" % __pyx_checksum)
23728  * __pyx_result = Enum.__new__(__pyx_type)
23729  * if __pyx_state is not None: # <<<<<<<<<<<<<<
23730  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23731  * return __pyx_result
23732  */
23733  }
23734 
23735  /* "(tree fragment)":10
23736  * if __pyx_state is not None:
23737  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23738  * return __pyx_result # <<<<<<<<<<<<<<
23739  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
23740  * __pyx_result.name = __pyx_state[0]
23741  */
23742  __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
23743  __Pyx_XDECREF(__pyx_r);
23744  __Pyx_INCREF(__pyx_v___pyx_result);
23745  __pyx_r = __pyx_v___pyx_result;
23746  goto __pyx_L0;
23747 
23748  /* "(tree fragment)":1
23749  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23750  * cdef object __pyx_PickleError
23751  * cdef object __pyx_result
23752  */
23753 
23754  /* function exit code */
23755  __pyx_L1_error:;
23756  __Pyx_XDECREF(__pyx_t_1);
23757  __Pyx_XDECREF(__pyx_t_4);
23758  __Pyx_XDECREF(__pyx_t_5);
23759  __Pyx_XDECREF(__pyx_t_6);
23760  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
23761  __pyx_r = NULL;
23762  __pyx_L0:;
23763  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
23764  __Pyx_XDECREF(__pyx_v___pyx_result);
23765  __Pyx_XGIVEREF(__pyx_r);
23766  __Pyx_TraceReturn(__pyx_r, 0);
23767  __Pyx_RefNannyFinishContext();
23768  return __pyx_r;
23769 }
23770 
23771 /* "(tree fragment)":11
23772  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23773  * return __pyx_result
23774  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23775  * __pyx_result.name = __pyx_state[0]
23776  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23777  */
23778 
23779 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
23780  PyObject *__pyx_r = NULL;
23781  __Pyx_TraceDeclarations
23782  __Pyx_RefNannyDeclarations
23783  PyObject *__pyx_t_1 = NULL;
23784  int __pyx_t_2;
23785  Py_ssize_t __pyx_t_3;
23786  int __pyx_t_4;
23787  int __pyx_t_5;
23788  PyObject *__pyx_t_6 = NULL;
23789  PyObject *__pyx_t_7 = NULL;
23790  PyObject *__pyx_t_8 = NULL;
23791  int __pyx_lineno = 0;
23792  const char *__pyx_filename = NULL;
23793  int __pyx_clineno = 0;
23794  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
23795  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
23796 
23797  /* "(tree fragment)":12
23798  * return __pyx_result
23799  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
23800  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
23801  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23802  * __pyx_result.__dict__.update(__pyx_state[1])
23803  */
23804  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
23805  if (unlikely(__pyx_v___pyx_state == Py_None)) {
23806  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23807  __PYX_ERR(1, 12, __pyx_L1_error)
23808  }
23809  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
23810  __Pyx_GOTREF(__pyx_t_1);
23811  __Pyx_GIVEREF(__pyx_t_1);
23812  __Pyx_GOTREF(__pyx_v___pyx_result->name);
23813  __Pyx_DECREF(__pyx_v___pyx_result->name);
23814  __pyx_v___pyx_result->name = __pyx_t_1;
23815  __pyx_t_1 = 0;
23816 
23817  /* "(tree fragment)":13
23818  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
23819  * __pyx_result.name = __pyx_state[0]
23820  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
23821  * __pyx_result.__dict__.update(__pyx_state[1])
23822  */
23823  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
23824  if (unlikely(__pyx_v___pyx_state == Py_None)) {
23825  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
23826  __PYX_ERR(1, 13, __pyx_L1_error)
23827  }
23828  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
23829  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
23830  if (__pyx_t_4) {
23831  } else {
23832  __pyx_t_2 = __pyx_t_4;
23833  goto __pyx_L4_bool_binop_done;
23834  }
23835  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
23836  __pyx_t_5 = (__pyx_t_4 != 0);
23837  __pyx_t_2 = __pyx_t_5;
23838  __pyx_L4_bool_binop_done:;
23839  if (__pyx_t_2) {
23840 
23841  /* "(tree fragment)":14
23842  * __pyx_result.name = __pyx_state[0]
23843  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23844  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
23845  */
23846  __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
23847  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
23848  __Pyx_GOTREF(__pyx_t_6);
23849  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
23850  __Pyx_GOTREF(__pyx_t_7);
23851  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23852  if (unlikely(__pyx_v___pyx_state == Py_None)) {
23853  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23854  __PYX_ERR(1, 14, __pyx_L1_error)
23855  }
23856  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
23857  __Pyx_GOTREF(__pyx_t_6);
23858  __pyx_t_8 = NULL;
23859  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
23860  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
23861  if (likely(__pyx_t_8)) {
23862  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
23863  __Pyx_INCREF(__pyx_t_8);
23864  __Pyx_INCREF(function);
23865  __Pyx_DECREF_SET(__pyx_t_7, function);
23866  }
23867  }
23868  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
23869  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23870  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23871  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
23872  __Pyx_GOTREF(__pyx_t_1);
23873  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23874  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23875 
23876  /* "(tree fragment)":13
23877  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
23878  * __pyx_result.name = __pyx_state[0]
23879  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
23880  * __pyx_result.__dict__.update(__pyx_state[1])
23881  */
23882  }
23883 
23884  /* "(tree fragment)":11
23885  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23886  * return __pyx_result
23887  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23888  * __pyx_result.name = __pyx_state[0]
23889  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23890  */
23891 
23892  /* function exit code */
23893  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23894  goto __pyx_L0;
23895  __pyx_L1_error:;
23896  __Pyx_XDECREF(__pyx_t_1);
23897  __Pyx_XDECREF(__pyx_t_6);
23898  __Pyx_XDECREF(__pyx_t_7);
23899  __Pyx_XDECREF(__pyx_t_8);
23900  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
23901  __pyx_r = 0;
23902  __pyx_L0:;
23903  __Pyx_XGIVEREF(__pyx_r);
23904  __Pyx_TraceReturn(__pyx_r, 0);
23905  __Pyx_RefNannyFinishContext();
23906  return __pyx_r;
23907 }
23908 static struct __pyx_vtabstruct_array __pyx_vtable_array;
23909 
23910 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
23911  struct __pyx_array_obj *p;
23912  PyObject *o;
23913  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
23914  o = (*t->tp_alloc)(t, 0);
23915  } else {
23916  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
23917  }
23918  if (unlikely(!o)) return 0;
23919  p = ((struct __pyx_array_obj *)o);
23920  p->__pyx_vtab = __pyx_vtabptr_array;
23921  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
23922  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
23923  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
23924  return o;
23925  bad:
23926  Py_DECREF(o); o = 0;
23927  return NULL;
23928 }
23929 
23930 static void __pyx_tp_dealloc_array(PyObject *o) {
23931  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
23932  #if CYTHON_USE_TP_FINALIZE
23933  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
23934  if (PyObject_CallFinalizerFromDealloc(o)) return;
23935  }
23936  #endif
23937  {
23938  PyObject *etype, *eval, *etb;
23939  PyErr_Fetch(&etype, &eval, &etb);
23940  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
23941  __pyx_array___dealloc__(o);
23942  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
23943  PyErr_Restore(etype, eval, etb);
23944  }
23945  Py_CLEAR(p->mode);
23946  Py_CLEAR(p->_format);
23947  (*Py_TYPE(o)->tp_free)(o);
23948 }
23949 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
23950  PyObject *r;
23951  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
23952  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
23953  Py_DECREF(x);
23954  return r;
23955 }
23956 
23957 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
23958  if (v) {
23959  return __pyx_array___setitem__(o, i, v);
23960  }
23961  else {
23962  PyErr_Format(PyExc_NotImplementedError,
23963  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
23964  return -1;
23965  }
23966 }
23967 
23968 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
23969  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
23970  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23971  PyErr_Clear();
23972  v = __pyx_array___getattr__(o, n);
23973  }
23974  return v;
23975 }
23976 
23977 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
23978  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
23979 }
23980 
23981 static PyMethodDef __pyx_methods_array[] = {
23982  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
23983  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
23984  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
23985  {0, 0, 0, 0}
23986 };
23987 
23988 static struct PyGetSetDef __pyx_getsets_array[] = {
23989  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
23990  {0, 0, 0, 0, 0}
23991 };
23992 
23993 static PySequenceMethods __pyx_tp_as_sequence_array = {
23994  __pyx_array___len__, /*sq_length*/
23995  0, /*sq_concat*/
23996  0, /*sq_repeat*/
23997  __pyx_sq_item_array, /*sq_item*/
23998  0, /*sq_slice*/
23999  0, /*sq_ass_item*/
24000  0, /*sq_ass_slice*/
24001  0, /*sq_contains*/
24002  0, /*sq_inplace_concat*/
24003  0, /*sq_inplace_repeat*/
24004 };
24005 
24006 static PyMappingMethods __pyx_tp_as_mapping_array = {
24007  __pyx_array___len__, /*mp_length*/
24008  __pyx_array___getitem__, /*mp_subscript*/
24009  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
24010 };
24011 
24012 static PyBufferProcs __pyx_tp_as_buffer_array = {
24013  #if PY_MAJOR_VERSION < 3
24014  0, /*bf_getreadbuffer*/
24015  #endif
24016  #if PY_MAJOR_VERSION < 3
24017  0, /*bf_getwritebuffer*/
24018  #endif
24019  #if PY_MAJOR_VERSION < 3
24020  0, /*bf_getsegcount*/
24021  #endif
24022  #if PY_MAJOR_VERSION < 3
24023  0, /*bf_getcharbuffer*/
24024  #endif
24025  __pyx_array_getbuffer, /*bf_getbuffer*/
24026  0, /*bf_releasebuffer*/
24027 };
24028 
24029 static PyTypeObject __pyx_type___pyx_array = {
24030  PyVarObject_HEAD_INIT(0, 0)
24031  "imate.traceinv._hutchinson_method.array", /*tp_name*/
24032  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
24033  0, /*tp_itemsize*/
24034  __pyx_tp_dealloc_array, /*tp_dealloc*/
24035  #if PY_VERSION_HEX < 0x030800b4
24036  0, /*tp_print*/
24037  #endif
24038  #if PY_VERSION_HEX >= 0x030800b4
24039  0, /*tp_vectorcall_offset*/
24040  #endif
24041  0, /*tp_getattr*/
24042  0, /*tp_setattr*/
24043  #if PY_MAJOR_VERSION < 3
24044  0, /*tp_compare*/
24045  #endif
24046  #if PY_MAJOR_VERSION >= 3
24047  0, /*tp_as_async*/
24048  #endif
24049  0, /*tp_repr*/
24050  0, /*tp_as_number*/
24051  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
24052  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
24053  0, /*tp_hash*/
24054  0, /*tp_call*/
24055  0, /*tp_str*/
24056  __pyx_tp_getattro_array, /*tp_getattro*/
24057  0, /*tp_setattro*/
24058  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
24059  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
24060  0, /*tp_doc*/
24061  0, /*tp_traverse*/
24062  0, /*tp_clear*/
24063  0, /*tp_richcompare*/
24064  0, /*tp_weaklistoffset*/
24065  0, /*tp_iter*/
24066  0, /*tp_iternext*/
24067  __pyx_methods_array, /*tp_methods*/
24068  0, /*tp_members*/
24069  __pyx_getsets_array, /*tp_getset*/
24070  0, /*tp_base*/
24071  0, /*tp_dict*/
24072  0, /*tp_descr_get*/
24073  0, /*tp_descr_set*/
24074  0, /*tp_dictoffset*/
24075  0, /*tp_init*/
24076  0, /*tp_alloc*/
24077  __pyx_tp_new_array, /*tp_new*/
24078  0, /*tp_free*/
24079  0, /*tp_is_gc*/
24080  0, /*tp_bases*/
24081  0, /*tp_mro*/
24082  0, /*tp_cache*/
24083  0, /*tp_subclasses*/
24084  0, /*tp_weaklist*/
24085  0, /*tp_del*/
24086  0, /*tp_version_tag*/
24087  #if PY_VERSION_HEX >= 0x030400a1
24088  0, /*tp_finalize*/
24089  #endif
24090  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24091  0, /*tp_vectorcall*/
24092  #endif
24093  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24094  0, /*tp_print*/
24095  #endif
24096  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24097  0, /*tp_pypy_flags*/
24098  #endif
24099 };
24100 
24101 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
24102  struct __pyx_MemviewEnum_obj *p;
24103  PyObject *o;
24104  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24105  o = (*t->tp_alloc)(t, 0);
24106  } else {
24107  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24108  }
24109  if (unlikely(!o)) return 0;
24110  p = ((struct __pyx_MemviewEnum_obj *)o);
24111  p->name = Py_None; Py_INCREF(Py_None);
24112  return o;
24113 }
24114 
24115 static void __pyx_tp_dealloc_Enum(PyObject *o) {
24116  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
24117  #if CYTHON_USE_TP_FINALIZE
24118  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
24119  if (PyObject_CallFinalizerFromDealloc(o)) return;
24120  }
24121  #endif
24122  PyObject_GC_UnTrack(o);
24123  Py_CLEAR(p->name);
24124  (*Py_TYPE(o)->tp_free)(o);
24125 }
24126 
24127 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
24128  int e;
24129  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
24130  if (p->name) {
24131  e = (*v)(p->name, a); if (e) return e;
24132  }
24133  return 0;
24134 }
24135 
24136 static int __pyx_tp_clear_Enum(PyObject *o) {
24137  PyObject* tmp;
24138  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
24139  tmp = ((PyObject*)p->name);
24140  p->name = Py_None; Py_INCREF(Py_None);
24141  Py_XDECREF(tmp);
24142  return 0;
24143 }
24144 
24145 static PyMethodDef __pyx_methods_Enum[] = {
24146  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
24147  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
24148  {0, 0, 0, 0}
24149 };
24150 
24151 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
24152  PyVarObject_HEAD_INIT(0, 0)
24153  "imate.traceinv._hutchinson_method.Enum", /*tp_name*/
24154  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
24155  0, /*tp_itemsize*/
24156  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
24157  #if PY_VERSION_HEX < 0x030800b4
24158  0, /*tp_print*/
24159  #endif
24160  #if PY_VERSION_HEX >= 0x030800b4
24161  0, /*tp_vectorcall_offset*/
24162  #endif
24163  0, /*tp_getattr*/
24164  0, /*tp_setattr*/
24165  #if PY_MAJOR_VERSION < 3
24166  0, /*tp_compare*/
24167  #endif
24168  #if PY_MAJOR_VERSION >= 3
24169  0, /*tp_as_async*/
24170  #endif
24171  __pyx_MemviewEnum___repr__, /*tp_repr*/
24172  0, /*tp_as_number*/
24173  0, /*tp_as_sequence*/
24174  0, /*tp_as_mapping*/
24175  0, /*tp_hash*/
24176  0, /*tp_call*/
24177  0, /*tp_str*/
24178  0, /*tp_getattro*/
24179  0, /*tp_setattro*/
24180  0, /*tp_as_buffer*/
24181  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
24182  0, /*tp_doc*/
24183  __pyx_tp_traverse_Enum, /*tp_traverse*/
24184  __pyx_tp_clear_Enum, /*tp_clear*/
24185  0, /*tp_richcompare*/
24186  0, /*tp_weaklistoffset*/
24187  0, /*tp_iter*/
24188  0, /*tp_iternext*/
24189  __pyx_methods_Enum, /*tp_methods*/
24190  0, /*tp_members*/
24191  0, /*tp_getset*/
24192  0, /*tp_base*/
24193  0, /*tp_dict*/
24194  0, /*tp_descr_get*/
24195  0, /*tp_descr_set*/
24196  0, /*tp_dictoffset*/
24197  __pyx_MemviewEnum___init__, /*tp_init*/
24198  0, /*tp_alloc*/
24199  __pyx_tp_new_Enum, /*tp_new*/
24200  0, /*tp_free*/
24201  0, /*tp_is_gc*/
24202  0, /*tp_bases*/
24203  0, /*tp_mro*/
24204  0, /*tp_cache*/
24205  0, /*tp_subclasses*/
24206  0, /*tp_weaklist*/
24207  0, /*tp_del*/
24208  0, /*tp_version_tag*/
24209  #if PY_VERSION_HEX >= 0x030400a1
24210  0, /*tp_finalize*/
24211  #endif
24212  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24213  0, /*tp_vectorcall*/
24214  #endif
24215  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24216  0, /*tp_print*/
24217  #endif
24218  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24219  0, /*tp_pypy_flags*/
24220  #endif
24221 };
24222 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
24223 
24224 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
24225  struct __pyx_memoryview_obj *p;
24226  PyObject *o;
24227  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
24228  o = (*t->tp_alloc)(t, 0);
24229  } else {
24230  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
24231  }
24232  if (unlikely(!o)) return 0;
24233  p = ((struct __pyx_memoryview_obj *)o);
24234  p->__pyx_vtab = __pyx_vtabptr_memoryview;
24235  p->obj = Py_None; Py_INCREF(Py_None);
24236  p->_size = Py_None; Py_INCREF(Py_None);
24237  p->_array_interface = Py_None; Py_INCREF(Py_None);
24238  p->view.obj = NULL;
24239  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
24240  return o;
24241  bad:
24242  Py_DECREF(o); o = 0;
24243  return NULL;
24244 }
24245 
24246 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
24247  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
24248  #if CYTHON_USE_TP_FINALIZE
24249  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
24250  if (PyObject_CallFinalizerFromDealloc(o)) return;
24251  }
24252  #endif
24253  PyObject_GC_UnTrack(o);
24254  {
24255  PyObject *etype, *eval, *etb;
24256  PyErr_Fetch(&etype, &eval, &etb);
24257  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
24258  __pyx_memoryview___dealloc__(o);
24259  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
24260  PyErr_Restore(etype, eval, etb);
24261  }
24262  Py_CLEAR(p->obj);
24263  Py_CLEAR(p->_size);
24264  Py_CLEAR(p->_array_interface);
24265  (*Py_TYPE(o)->tp_free)(o);
24266 }
24267 
24268 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
24269  int e;
24270  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
24271  if (p->obj) {
24272  e = (*v)(p->obj, a); if (e) return e;
24273  }
24274  if (p->_size) {
24275  e = (*v)(p->_size, a); if (e) return e;
24276  }
24277  if (p->_array_interface) {
24278  e = (*v)(p->_array_interface, a); if (e) return e;
24279  }
24280  if (p->view.obj) {
24281  e = (*v)(p->view.obj, a); if (e) return e;
24282  }
24283  return 0;
24284 }
24285 
24286 static int __pyx_tp_clear_memoryview(PyObject *o) {
24287  PyObject* tmp;
24288  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
24289  tmp = ((PyObject*)p->obj);
24290  p->obj = Py_None; Py_INCREF(Py_None);
24291  Py_XDECREF(tmp);
24292  tmp = ((PyObject*)p->_size);
24293  p->_size = Py_None; Py_INCREF(Py_None);
24294  Py_XDECREF(tmp);
24295  tmp = ((PyObject*)p->_array_interface);
24296  p->_array_interface = Py_None; Py_INCREF(Py_None);
24297  Py_XDECREF(tmp);
24298  Py_CLEAR(p->view.obj);
24299  return 0;
24300 }
24301 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
24302  PyObject *r;
24303  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
24304  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
24305  Py_DECREF(x);
24306  return r;
24307 }
24308 
24309 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
24310  if (v) {
24311  return __pyx_memoryview___setitem__(o, i, v);
24312  }
24313  else {
24314  PyErr_Format(PyExc_NotImplementedError,
24315  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
24316  return -1;
24317  }
24318 }
24319 
24320 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
24321  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
24322 }
24323 
24324 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
24325  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
24326 }
24327 
24328 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
24329  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
24330 }
24331 
24332 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
24333  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
24334 }
24335 
24336 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
24337  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
24338 }
24339 
24340 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
24341  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
24342 }
24343 
24344 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
24345  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
24346 }
24347 
24348 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
24349  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
24350 }
24351 
24352 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
24353  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
24354 }
24355 
24356 static PyMethodDef __pyx_methods_memoryview[] = {
24357  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
24358  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
24359  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
24360  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
24361  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
24362  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
24363  {0, 0, 0, 0}
24364 };
24365 
24366 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
24367  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
24368  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
24369  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
24370  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
24371  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
24372  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
24373  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
24374  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
24375  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
24376  {0, 0, 0, 0, 0}
24377 };
24378 
24379 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
24380  __pyx_memoryview___len__, /*sq_length*/
24381  0, /*sq_concat*/
24382  0, /*sq_repeat*/
24383  __pyx_sq_item_memoryview, /*sq_item*/
24384  0, /*sq_slice*/
24385  0, /*sq_ass_item*/
24386  0, /*sq_ass_slice*/
24387  0, /*sq_contains*/
24388  0, /*sq_inplace_concat*/
24389  0, /*sq_inplace_repeat*/
24390 };
24391 
24392 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
24393  __pyx_memoryview___len__, /*mp_length*/
24394  __pyx_memoryview___getitem__, /*mp_subscript*/
24395  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
24396 };
24397 
24398 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
24399  #if PY_MAJOR_VERSION < 3
24400  0, /*bf_getreadbuffer*/
24401  #endif
24402  #if PY_MAJOR_VERSION < 3
24403  0, /*bf_getwritebuffer*/
24404  #endif
24405  #if PY_MAJOR_VERSION < 3
24406  0, /*bf_getsegcount*/
24407  #endif
24408  #if PY_MAJOR_VERSION < 3
24409  0, /*bf_getcharbuffer*/
24410  #endif
24411  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
24412  0, /*bf_releasebuffer*/
24413 };
24414 
24415 static PyTypeObject __pyx_type___pyx_memoryview = {
24416  PyVarObject_HEAD_INIT(0, 0)
24417  "imate.traceinv._hutchinson_method.memoryview", /*tp_name*/
24418  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
24419  0, /*tp_itemsize*/
24420  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
24421  #if PY_VERSION_HEX < 0x030800b4
24422  0, /*tp_print*/
24423  #endif
24424  #if PY_VERSION_HEX >= 0x030800b4
24425  0, /*tp_vectorcall_offset*/
24426  #endif
24427  0, /*tp_getattr*/
24428  0, /*tp_setattr*/
24429  #if PY_MAJOR_VERSION < 3
24430  0, /*tp_compare*/
24431  #endif
24432  #if PY_MAJOR_VERSION >= 3
24433  0, /*tp_as_async*/
24434  #endif
24435  __pyx_memoryview___repr__, /*tp_repr*/
24436  0, /*tp_as_number*/
24437  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
24438  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
24439  0, /*tp_hash*/
24440  0, /*tp_call*/
24441  __pyx_memoryview___str__, /*tp_str*/
24442  0, /*tp_getattro*/
24443  0, /*tp_setattro*/
24444  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
24445  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
24446  0, /*tp_doc*/
24447  __pyx_tp_traverse_memoryview, /*tp_traverse*/
24448  __pyx_tp_clear_memoryview, /*tp_clear*/
24449  0, /*tp_richcompare*/
24450  0, /*tp_weaklistoffset*/
24451  0, /*tp_iter*/
24452  0, /*tp_iternext*/
24453  __pyx_methods_memoryview, /*tp_methods*/
24454  0, /*tp_members*/
24455  __pyx_getsets_memoryview, /*tp_getset*/
24456  0, /*tp_base*/
24457  0, /*tp_dict*/
24458  0, /*tp_descr_get*/
24459  0, /*tp_descr_set*/
24460  0, /*tp_dictoffset*/
24461  0, /*tp_init*/
24462  0, /*tp_alloc*/
24463  __pyx_tp_new_memoryview, /*tp_new*/
24464  0, /*tp_free*/
24465  0, /*tp_is_gc*/
24466  0, /*tp_bases*/
24467  0, /*tp_mro*/
24468  0, /*tp_cache*/
24469  0, /*tp_subclasses*/
24470  0, /*tp_weaklist*/
24471  0, /*tp_del*/
24472  0, /*tp_version_tag*/
24473  #if PY_VERSION_HEX >= 0x030400a1
24474  0, /*tp_finalize*/
24475  #endif
24476  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24477  0, /*tp_vectorcall*/
24478  #endif
24479  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24480  0, /*tp_print*/
24481  #endif
24482  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24483  0, /*tp_pypy_flags*/
24484  #endif
24485 };
24486 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
24487 
24488 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
24489  struct __pyx_memoryviewslice_obj *p;
24490  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
24491  if (unlikely(!o)) return 0;
24492  p = ((struct __pyx_memoryviewslice_obj *)o);
24493  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
24494  p->from_object = Py_None; Py_INCREF(Py_None);
24495  p->from_slice.memview = NULL;
24496  return o;
24497 }
24498 
24499 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
24500  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
24501  #if CYTHON_USE_TP_FINALIZE
24502  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !__Pyx_PyObject_GC_IsFinalized(o)) {
24503  if (PyObject_CallFinalizerFromDealloc(o)) return;
24504  }
24505  #endif
24506  PyObject_GC_UnTrack(o);
24507  {
24508  PyObject *etype, *eval, *etb;
24509  PyErr_Fetch(&etype, &eval, &etb);
24510  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
24511  __pyx_memoryviewslice___dealloc__(o);
24512  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
24513  PyErr_Restore(etype, eval, etb);
24514  }
24515  Py_CLEAR(p->from_object);
24516  PyObject_GC_Track(o);
24517  __pyx_tp_dealloc_memoryview(o);
24518 }
24519 
24520 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
24521  int e;
24522  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
24523  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
24524  if (p->from_object) {
24525  e = (*v)(p->from_object, a); if (e) return e;
24526  }
24527  return 0;
24528 }
24529 
24530 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
24531  PyObject* tmp;
24532  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
24533  __pyx_tp_clear_memoryview(o);
24534  tmp = ((PyObject*)p->from_object);
24535  p->from_object = Py_None; Py_INCREF(Py_None);
24536  Py_XDECREF(tmp);
24537  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
24538  return 0;
24539 }
24540 
24541 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
24542  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
24543 }
24544 
24545 static PyMethodDef __pyx_methods__memoryviewslice[] = {
24546  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
24547  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
24548  {0, 0, 0, 0}
24549 };
24550 
24551 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
24552  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
24553  {0, 0, 0, 0, 0}
24554 };
24555 
24556 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
24557  PyVarObject_HEAD_INIT(0, 0)
24558  "imate.traceinv._hutchinson_method._memoryviewslice", /*tp_name*/
24559  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
24560  0, /*tp_itemsize*/
24561  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
24562  #if PY_VERSION_HEX < 0x030800b4
24563  0, /*tp_print*/
24564  #endif
24565  #if PY_VERSION_HEX >= 0x030800b4
24566  0, /*tp_vectorcall_offset*/
24567  #endif
24568  0, /*tp_getattr*/
24569  0, /*tp_setattr*/
24570  #if PY_MAJOR_VERSION < 3
24571  0, /*tp_compare*/
24572  #endif
24573  #if PY_MAJOR_VERSION >= 3
24574  0, /*tp_as_async*/
24575  #endif
24576  #if CYTHON_COMPILING_IN_PYPY
24577  __pyx_memoryview___repr__, /*tp_repr*/
24578  #else
24579  0, /*tp_repr*/
24580  #endif
24581  0, /*tp_as_number*/
24582  0, /*tp_as_sequence*/
24583  0, /*tp_as_mapping*/
24584  0, /*tp_hash*/
24585  0, /*tp_call*/
24586  #if CYTHON_COMPILING_IN_PYPY
24587  __pyx_memoryview___str__, /*tp_str*/
24588  #else
24589  0, /*tp_str*/
24590  #endif
24591  0, /*tp_getattro*/
24592  0, /*tp_setattro*/
24593  0, /*tp_as_buffer*/
24594  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
24595  "Internal class for passing memoryview slices to Python", /*tp_doc*/
24596  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
24597  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
24598  0, /*tp_richcompare*/
24599  0, /*tp_weaklistoffset*/
24600  0, /*tp_iter*/
24601  0, /*tp_iternext*/
24602  __pyx_methods__memoryviewslice, /*tp_methods*/
24603  0, /*tp_members*/
24604  __pyx_getsets__memoryviewslice, /*tp_getset*/
24605  0, /*tp_base*/
24606  0, /*tp_dict*/
24607  0, /*tp_descr_get*/
24608  0, /*tp_descr_set*/
24609  0, /*tp_dictoffset*/
24610  0, /*tp_init*/
24611  0, /*tp_alloc*/
24612  __pyx_tp_new__memoryviewslice, /*tp_new*/
24613  0, /*tp_free*/
24614  0, /*tp_is_gc*/
24615  0, /*tp_bases*/
24616  0, /*tp_mro*/
24617  0, /*tp_cache*/
24618  0, /*tp_subclasses*/
24619  0, /*tp_weaklist*/
24620  0, /*tp_del*/
24621  0, /*tp_version_tag*/
24622  #if PY_VERSION_HEX >= 0x030400a1
24623  0, /*tp_finalize*/
24624  #endif
24625  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24626  0, /*tp_vectorcall*/
24627  #endif
24628  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
24629  0, /*tp_print*/
24630  #endif
24631  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24632  0, /*tp_pypy_flags*/
24633  #endif
24634 };
24635 
24636 static PyMethodDef __pyx_methods[] = {
24637  {0, 0, 0, 0}
24638 };
24639 
24640 #if PY_MAJOR_VERSION >= 3
24641 #if CYTHON_PEP489_MULTI_PHASE_INIT
24642 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
24643 static int __pyx_pymod_exec__hutchinson_method(PyObject* module); /*proto*/
24644 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
24645  {Py_mod_create, (void*)__pyx_pymod_create},
24646  {Py_mod_exec, (void*)__pyx_pymod_exec__hutchinson_method},
24647  {0, NULL}
24648 };
24649 #endif
24650 
24651 static struct PyModuleDef __pyx_moduledef = {
24652  PyModuleDef_HEAD_INIT,
24653  "_hutchinson_method",
24654  0, /* m_doc */
24655  #if CYTHON_PEP489_MULTI_PHASE_INIT
24656  0, /* m_size */
24657  #else
24658  -1, /* m_size */
24659  #endif
24660  __pyx_methods /* m_methods */,
24661  #if CYTHON_PEP489_MULTI_PHASE_INIT
24662  __pyx_moduledef_slots, /* m_slots */
24663  #else
24664  NULL, /* m_reload */
24665  #endif
24666  NULL, /* m_traverse */
24667  NULL, /* m_clear */
24668  NULL /* m_free */
24669 };
24670 #endif
24671 #ifndef CYTHON_SMALL_CODE
24672 #if defined(__clang__)
24673  #define CYTHON_SMALL_CODE
24674 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
24675  #define CYTHON_SMALL_CODE __attribute__((cold))
24676 #else
24677  #define CYTHON_SMALL_CODE
24678 #endif
24679 #endif
24680 
24681 static __Pyx_StringTabEntry __pyx_string_tab[] = {
24682  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
24683  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
24684  {&__pyx_n_s_AinvpE, __pyx_k_AinvpE, sizeof(__pyx_k_AinvpE), 0, 0, 1, 1},
24685  {&__pyx_n_s_AtA, __pyx_k_AtA, sizeof(__pyx_k_AtA), 0, 0, 1, 1},
24686  {&__pyx_kp_u_AtA_cannot_be_None, __pyx_k_AtA_cannot_be_None, sizeof(__pyx_k_AtA_cannot_be_None), 0, 1, 0, 0},
24687  {&__pyx_n_s_B, __pyx_k_B, sizeof(__pyx_k_B), 0, 0, 1, 1},
24688  {&__pyx_n_s_BE, __pyx_k_BE, sizeof(__pyx_k_BE), 0, 0, 1, 1},
24689  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
24690  {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
24691  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
24692  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
24693  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
24694  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
24695  {&__pyx_kp_u_Data_type_should_be_either_float, __pyx_k_Data_type_should_be_either_float, sizeof(__pyx_k_Data_type_should_be_either_float), 0, 1, 0, 0},
24696  {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
24697  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
24698  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
24699  {&__pyx_n_u_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 1, 0, 1},
24700  {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
24701  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
24702  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
24703  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
24704  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
24705  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
24706  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
24707  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
24708  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
24709  {&__pyx_n_s_OpE, __pyx_k_OpE, sizeof(__pyx_k_OpE), 0, 0, 1, 1},
24710  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
24711  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
24712  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
24713  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
24714  {&__pyx_kp_u_Trace_of_matrix_or_linear_opera, __pyx_k_Trace_of_matrix_or_linear_opera, sizeof(__pyx_k_Trace_of_matrix_or_linear_opera), 0, 1, 0, 0},
24715  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
24716  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
24717  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
24718  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
24719  {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
24720  {&__pyx_n_u_absolute_error, __pyx_k_absolute_error, sizeof(__pyx_k_absolute_error), 0, 1, 0, 1},
24721  {&__pyx_n_s_alg_wall_time, __pyx_k_alg_wall_time, sizeof(__pyx_k_alg_wall_time), 0, 0, 1, 1},
24722  {&__pyx_n_u_alg_wall_time, __pyx_k_alg_wall_time, sizeof(__pyx_k_alg_wall_time), 0, 1, 0, 1},
24723  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
24724  {&__pyx_n_s_assume_matrix, __pyx_k_assume_matrix, sizeof(__pyx_k_assume_matrix), 0, 0, 1, 1},
24725  {&__pyx_n_u_assume_matrix, __pyx_k_assume_matrix, sizeof(__pyx_k_assume_matrix), 0, 1, 0, 1},
24726  {&__pyx_n_s_average_estimates, __pyx_k_average_estimates, sizeof(__pyx_k_average_estimates), 0, 0, 1, 1},
24727  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
24728  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
24729  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
24730  {&__pyx_n_s_cE, __pyx_k_cE, sizeof(__pyx_k_cE), 0, 0, 1, 1},
24731  {&__pyx_n_s_check_arguments, __pyx_k_check_arguments, sizeof(__pyx_k_check_arguments), 0, 0, 1, 1},
24732  {&__pyx_n_s_check_convergence, __pyx_k_check_convergence, sizeof(__pyx_k_check_convergence), 0, 0, 1, 1},
24733  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
24734  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
24735  {&__pyx_n_s_confidence_level, __pyx_k_confidence_level, sizeof(__pyx_k_confidence_level), 0, 0, 1, 1},
24736  {&__pyx_n_u_confidence_level, __pyx_k_confidence_level, sizeof(__pyx_k_confidence_level), 0, 1, 0, 1},
24737  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
24738  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
24739  {&__pyx_n_s_converged, __pyx_k_converged, sizeof(__pyx_k_converged), 0, 0, 1, 1},
24740  {&__pyx_n_u_converged, __pyx_k_converged, sizeof(__pyx_k_converged), 0, 1, 0, 1},
24741  {&__pyx_n_u_convergence, __pyx_k_convergence, sizeof(__pyx_k_convergence), 0, 1, 0, 1},
24742  {&__pyx_n_s_convergence_tools, __pyx_k_convergence_tools, sizeof(__pyx_k_convergence_tools), 0, 0, 1, 1},
24743  {&__pyx_n_s_cpu_count, __pyx_k_cpu_count, sizeof(__pyx_k_cpu_count), 0, 0, 1, 1},
24744  {&__pyx_n_s_cpu_proc_time, __pyx_k_cpu_proc_time, sizeof(__pyx_k_cpu_proc_time), 0, 0, 1, 1},
24745  {&__pyx_n_u_cpu_proc_time, __pyx_k_cpu_proc_time, sizeof(__pyx_k_cpu_proc_time), 0, 1, 0, 1},
24746  {&__pyx_n_u_data_type, __pyx_k_data_type, sizeof(__pyx_k_data_type), 0, 1, 0, 1},
24747  {&__pyx_n_s_data_type_name, __pyx_k_data_type_name, sizeof(__pyx_k_data_type_name), 0, 0, 1, 1},
24748  {&__pyx_n_u_density, __pyx_k_density, sizeof(__pyx_k_density), 0, 1, 0, 1},
24749  {&__pyx_n_u_device, __pyx_k_device, sizeof(__pyx_k_device), 0, 1, 0, 1},
24750  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
24751  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
24752  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
24753  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
24754  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
24755  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
24756  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
24757  {&__pyx_n_u_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 1, 0, 1},
24758  {&__pyx_n_s_error_atol, __pyx_k_error_atol, sizeof(__pyx_k_error_atol), 0, 0, 1, 1},
24759  {&__pyx_n_u_error_atol, __pyx_k_error_atol, sizeof(__pyx_k_error_atol), 0, 1, 0, 1},
24760  {&__pyx_n_s_error_rtol, __pyx_k_error_rtol, sizeof(__pyx_k_error_rtol), 0, 0, 1, 1},
24761  {&__pyx_n_u_error_rtol, __pyx_k_error_rtol, sizeof(__pyx_k_error_rtol), 0, 1, 0, 1},
24762  {&__pyx_n_u_exponent, __pyx_k_exponent, sizeof(__pyx_k_exponent), 0, 1, 0, 1},
24763  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
24764  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
24765  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
24766  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
24767  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
24768  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
24769  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
24770  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
24771  {&__pyx_n_u_gen, __pyx_k_gen, sizeof(__pyx_k_gen), 0, 1, 0, 1},
24772  {&__pyx_n_s_get_data_type_name, __pyx_k_get_data_type_name, sizeof(__pyx_k_get_data_type_name), 0, 0, 1, 1},
24773  {&__pyx_n_s_get_density, __pyx_k_get_density, sizeof(__pyx_k_get_density), 0, 0, 1, 1},
24774  {&__pyx_n_s_get_nnz, __pyx_k_get_nnz, sizeof(__pyx_k_get_nnz), 0, 0, 1, 1},
24775  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
24776  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
24777  {&__pyx_n_s_gram, __pyx_k_gram, sizeof(__pyx_k_gram), 0, 0, 1, 1},
24778  {&__pyx_n_u_gram, __pyx_k_gram, sizeof(__pyx_k_gram), 0, 1, 0, 1},
24779  {&__pyx_n_u_hutchinson, __pyx_k_hutchinson, sizeof(__pyx_k_hutchinson), 0, 1, 0, 1},
24780  {&__pyx_n_s_hutchinson_method, __pyx_k_hutchinson_method, sizeof(__pyx_k_hutchinson_method), 0, 0, 1, 1},
24781  {&__pyx_n_s_hutchinson_method_double, __pyx_k_hutchinson_method_double, sizeof(__pyx_k_hutchinson_method_double), 0, 0, 1, 1},
24782  {&__pyx_n_s_hutchinson_method_float, __pyx_k_hutchinson_method_float, sizeof(__pyx_k_hutchinson_method_float), 0, 0, 1, 1},
24783  {&__pyx_kp_u_hutchinson_method_line_37, __pyx_k_hutchinson_method_line_37, sizeof(__pyx_k_hutchinson_method_line_37), 0, 1, 0, 0},
24784  {&__pyx_n_s_hutchinson_method_utilities, __pyx_k_hutchinson_method_utilities, sizeof(__pyx_k_hutchinson_method_utilities), 0, 0, 1, 1},
24785  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
24786  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
24787  {&__pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_k_imate_traceinv__hutchinson_metho, sizeof(__pyx_k_imate_traceinv__hutchinson_metho), 0, 0, 1, 0},
24788  {&__pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_k_imate_traceinv__hutchinson_metho_2, sizeof(__pyx_k_imate_traceinv__hutchinson_metho_2), 0, 0, 1, 1},
24789  {&__pyx_n_s_imatmul, __pyx_k_imatmul, sizeof(__pyx_k_imatmul), 0, 0, 1, 1},
24790  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
24791  {&__pyx_n_s_info, __pyx_k_info, sizeof(__pyx_k_info), 0, 0, 1, 1},
24792  {&__pyx_n_s_init_alg_wall_time, __pyx_k_init_alg_wall_time, sizeof(__pyx_k_init_alg_wall_time), 0, 0, 1, 1},
24793  {&__pyx_n_s_init_cpu_proc_time, __pyx_k_init_cpu_proc_time, sizeof(__pyx_k_init_cpu_proc_time), 0, 0, 1, 1},
24794  {&__pyx_n_s_init_tot_wall_time, __pyx_k_init_tot_wall_time, sizeof(__pyx_k_init_tot_wall_time), 0, 0, 1, 1},
24795  {&__pyx_n_s_isspmatrix, __pyx_k_isspmatrix, sizeof(__pyx_k_isspmatrix), 0, 0, 1, 1},
24796  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
24797  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
24798  {&__pyx_n_s_linear_algebra, __pyx_k_linear_algebra, sizeof(__pyx_k_linear_algebra), 0, 0, 1, 1},
24799  {&__pyx_n_s_linear_algebra_matrix_utilities, __pyx_k_linear_algebra_matrix_utilities, sizeof(__pyx_k_linear_algebra_matrix_utilities), 0, 0, 1, 1},
24800  {&__pyx_n_s_linear_solver, __pyx_k_linear_solver, sizeof(__pyx_k_linear_solver), 0, 0, 1, 1},
24801  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
24802  {&__pyx_n_s_matmul, __pyx_k_matmul, sizeof(__pyx_k_matmul), 0, 0, 1, 1},
24803  {&__pyx_n_u_matrix, __pyx_k_matrix, sizeof(__pyx_k_matrix), 0, 1, 0, 1},
24804  {&__pyx_n_s_max_num_samples, __pyx_k_max_num_samples, sizeof(__pyx_k_max_num_samples), 0, 0, 1, 1},
24805  {&__pyx_n_u_max_num_samples, __pyx_k_max_num_samples, sizeof(__pyx_k_max_num_samples), 0, 1, 0, 1},
24806  {&__pyx_n_s_memoryview_E, __pyx_k_memoryview_E, sizeof(__pyx_k_memoryview_E), 0, 0, 1, 1},
24807  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
24808  {&__pyx_n_u_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 1, 0, 1},
24809  {&__pyx_n_s_min_num_samples, __pyx_k_min_num_samples, sizeof(__pyx_k_min_num_samples), 0, 0, 1, 1},
24810  {&__pyx_n_u_min_num_samples, __pyx_k_min_num_samples, sizeof(__pyx_k_min_num_samples), 0, 1, 0, 1},
24811  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
24812  {&__pyx_n_s_multiprocessing, __pyx_k_multiprocessing, sizeof(__pyx_k_multiprocessing), 0, 0, 1, 1},
24813  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
24814  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
24815  {&__pyx_n_s_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 0, 0, 1, 1},
24816  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
24817  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
24818  {&__pyx_n_u_nnz, __pyx_k_nnz, sizeof(__pyx_k_nnz), 0, 1, 0, 1},
24819  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
24820  {&__pyx_n_u_num_cpu_threads, __pyx_k_num_cpu_threads, sizeof(__pyx_k_num_cpu_threads), 0, 1, 0, 1},
24821  {&__pyx_n_u_num_gpu_devices, __pyx_k_num_gpu_devices, sizeof(__pyx_k_num_gpu_devices), 0, 1, 0, 1},
24822  {&__pyx_n_u_num_gpu_multiprocessors, __pyx_k_num_gpu_multiprocessors, sizeof(__pyx_k_num_gpu_multiprocessors), 0, 1, 0, 1},
24823  {&__pyx_n_u_num_gpu_threads_per_multiprocess, __pyx_k_num_gpu_threads_per_multiprocess, sizeof(__pyx_k_num_gpu_threads_per_multiprocess), 0, 1, 0, 1},
24824  {&__pyx_n_u_num_inquiries, __pyx_k_num_inquiries, sizeof(__pyx_k_num_inquiries), 0, 1, 0, 1},
24825  {&__pyx_n_s_num_outliers, __pyx_k_num_outliers, sizeof(__pyx_k_num_outliers), 0, 0, 1, 1},
24826  {&__pyx_n_u_num_outliers, __pyx_k_num_outliers, sizeof(__pyx_k_num_outliers), 0, 1, 0, 1},
24827  {&__pyx_n_s_num_processed_samples, __pyx_k_num_processed_samples, sizeof(__pyx_k_num_processed_samples), 0, 0, 1, 1},
24828  {&__pyx_n_s_num_samples_used, __pyx_k_num_samples_used, sizeof(__pyx_k_num_samples_used), 0, 0, 1, 1},
24829  {&__pyx_n_u_num_samples_used, __pyx_k_num_samples_used, sizeof(__pyx_k_num_samples_used), 0, 1, 0, 1},
24830  {&__pyx_n_s_num_threads, __pyx_k_num_threads, sizeof(__pyx_k_num_threads), 0, 0, 1, 1},
24831  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
24832  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
24833  {&__pyx_n_s_operator_dot, __pyx_k_operator_dot, sizeof(__pyx_k_operator_dot), 0, 0, 1, 1},
24834  {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
24835  {&__pyx_n_s_orthogonalize, __pyx_k_orthogonalize, sizeof(__pyx_k_orthogonalize), 0, 0, 1, 1},
24836  {&__pyx_n_u_orthogonalize, __pyx_k_orthogonalize, sizeof(__pyx_k_orthogonalize), 0, 1, 0, 1},
24837  {&__pyx_n_s_outlier_significance_level, __pyx_k_outlier_significance_level, sizeof(__pyx_k_outlier_significance_level), 0, 0, 1, 1},
24838  {&__pyx_n_u_outlier_significance_level, __pyx_k_outlier_significance_level, sizeof(__pyx_k_outlier_significance_level), 0, 1, 0, 1},
24839  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
24840  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
24841  {&__pyx_n_s_perf_counter, __pyx_k_perf_counter, sizeof(__pyx_k_perf_counter), 0, 0, 1, 1},
24842  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
24843  {&__pyx_n_s_plot, __pyx_k_plot, sizeof(__pyx_k_plot), 0, 0, 1, 1},
24844  {&__pyx_n_s_plot_convergence, __pyx_k_plot_convergence, sizeof(__pyx_k_plot_convergence), 0, 0, 1, 1},
24845  {&__pyx_n_s_print_summary, __pyx_k_print_summary, sizeof(__pyx_k_print_summary), 0, 0, 1, 1},
24846  {&__pyx_n_s_process_time, __pyx_k_process_time, sizeof(__pyx_k_process_time), 0, 0, 1, 1},
24847  {&__pyx_n_s_processed_samples_indices, __pyx_k_processed_samples_indices, sizeof(__pyx_k_processed_samples_indices), 0, 0, 1, 1},
24848  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
24849  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
24850  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
24851  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
24852  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
24853  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
24854  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
24855  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
24856  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
24857  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
24858  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
24859  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
24860  {&__pyx_n_u_relative_error, __pyx_k_relative_error, sizeof(__pyx_k_relative_error), 0, 1, 0, 1},
24861  {&__pyx_n_s_return_info, __pyx_k_return_info, sizeof(__pyx_k_return_info), 0, 0, 1, 1},
24862  {&__pyx_n_s_rmatmul, __pyx_k_rmatmul, sizeof(__pyx_k_rmatmul), 0, 0, 1, 1},
24863  {&__pyx_n_s_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 0, 1, 1},
24864  {&__pyx_n_u_samples, __pyx_k_samples, sizeof(__pyx_k_samples), 0, 1, 0, 1},
24865  {&__pyx_n_u_samples_mean, __pyx_k_samples_mean, sizeof(__pyx_k_samples_mean), 0, 1, 0, 1},
24866  {&__pyx_n_u_samples_processed_order, __pyx_k_samples_processed_order, sizeof(__pyx_k_samples_processed_order), 0, 1, 0, 1},
24867  {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1},
24868  {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
24869  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
24870  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
24871  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
24872  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
24873  {&__pyx_n_u_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 1, 0, 1},
24874  {&__pyx_n_u_solver, __pyx_k_solver, sizeof(__pyx_k_solver), 0, 1, 0, 1},
24875  {&__pyx_n_s_solver_tol, __pyx_k_solver_tol, sizeof(__pyx_k_solver_tol), 0, 0, 1, 1},
24876  {&__pyx_n_u_solver_tol, __pyx_k_solver_tol, sizeof(__pyx_k_solver_tol), 0, 1, 0, 1},
24877  {&__pyx_n_u_sparse, __pyx_k_sparse, sizeof(__pyx_k_sparse), 0, 1, 0, 1},
24878  {&__pyx_n_s_square, __pyx_k_square, sizeof(__pyx_k_square), 0, 0, 1, 1},
24879  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
24880  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
24881  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
24882  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
24883  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
24884  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
24885  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
24886  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
24887  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
24888  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
24889  {&__pyx_n_u_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 1, 0, 1},
24890  {&__pyx_n_s_tot_wall_time, __pyx_k_tot_wall_time, sizeof(__pyx_k_tot_wall_time), 0, 0, 1, 1},
24891  {&__pyx_n_u_tot_wall_time, __pyx_k_tot_wall_time, sizeof(__pyx_k_tot_wall_time), 0, 1, 0, 1},
24892  {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1},
24893  {&__pyx_n_s_trace_estimator_trace_estimator, __pyx_k_trace_estimator_trace_estimator, sizeof(__pyx_k_trace_estimator_trace_estimator), 0, 0, 1, 1},
24894  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
24895  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
24896  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
24897  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
24898  {&__pyx_n_s_vector_size, __pyx_k_vector_size, sizeof(__pyx_k_vector_size), 0, 0, 1, 1},
24899  {&__pyx_n_s_verbose, __pyx_k_verbose, sizeof(__pyx_k_verbose), 0, 0, 1, 1},
24900  {&__pyx_n_u_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 1, 0, 1},
24901  {&__pyx_n_s_version_2, __pyx_k_version_2, sizeof(__pyx_k_version_2), 0, 0, 1, 1},
24902  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
24903  {0, 0, 0, 0, 0, 0, 0}
24904 };
24905 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
24906  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 646, __pyx_L1_error)
24907  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 780, __pyx_L1_error)
24908  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 955, __pyx_L1_error)
24909  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 134, __pyx_L1_error)
24910  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 149, __pyx_L1_error)
24911  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 152, __pyx_L1_error)
24912  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 406, __pyx_L1_error)
24913  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 615, __pyx_L1_error)
24914  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 834, __pyx_L1_error)
24915  return 0;
24916  __pyx_L1_error:;
24917  return -1;
24918 }
24919 
24920 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
24921  __Pyx_RefNannyDeclarations
24922  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
24923 
24924  /* "imate/traceinv/_hutchinson_method.pyx":646
24925  * num_threads)
24926  * else:
24927  * raise TypeError('Data type should be either "float32" or "float64"') # <<<<<<<<<<<<<<
24928  *
24929  * # Dictionary of output info
24930  */
24931  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_either_float); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 646, __pyx_L1_error)
24932  __Pyx_GOTREF(__pyx_tuple__2);
24933  __Pyx_GIVEREF(__pyx_tuple__2);
24934 
24935  /* "imate/traceinv/_hutchinson_method.pyx":762
24936  * samples = numpy.zeros((max_num_samples, ), dtype=numpy.float32)
24937  * processed_samples_indices = numpy.zeros((max_num_samples, ), dtype=int)
24938  * samples[:] = numpy.nan # <<<<<<<<<<<<<<
24939  * cdef int num_processed_samples = 0
24940  * cdef int num_samples_used = 0
24941  */
24942  __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 762, __pyx_L1_error)
24943  __Pyx_GOTREF(__pyx_slice__4);
24944  __Pyx_GIVEREF(__pyx_slice__4);
24945 
24946  /* "imate/traceinv/_hutchinson_method.pyx":955
24947  * if gram and (AtA is None):
24948  * if not ((p == 1) and (B is None) and (C is None)):
24949  * raise RuntimeError('"AtA" cannot be None.') # <<<<<<<<<<<<<<
24950  *
24951  * # Multiply operator * B * E
24952  */
24953  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_AtA_cannot_be_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 955, __pyx_L1_error)
24954  __Pyx_GOTREF(__pyx_tuple__6);
24955  __Pyx_GIVEREF(__pyx_tuple__6);
24956 
24957  /* "View.MemoryView":134
24958  *
24959  * if not self.ndim:
24960  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
24961  *
24962  * if itemsize <= 0:
24963  */
24964  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 134, __pyx_L1_error)
24965  __Pyx_GOTREF(__pyx_tuple__8);
24966  __Pyx_GIVEREF(__pyx_tuple__8);
24967 
24968  /* "View.MemoryView":137
24969  *
24970  * if itemsize <= 0:
24971  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
24972  *
24973  * if not isinstance(format, bytes):
24974  */
24975  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 137, __pyx_L1_error)
24976  __Pyx_GOTREF(__pyx_tuple__9);
24977  __Pyx_GIVEREF(__pyx_tuple__9);
24978 
24979  /* "View.MemoryView":149
24980  *
24981  * if not self._shape:
24982  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
24983  *
24984  *
24985  */
24986  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 149, __pyx_L1_error)
24987  __Pyx_GOTREF(__pyx_tuple__10);
24988  __Pyx_GIVEREF(__pyx_tuple__10);
24989 
24990  /* "View.MemoryView":177
24991  * self.data = <char *>malloc(self.len)
24992  * if not self.data:
24993  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
24994  *
24995  * if self.dtype_is_object:
24996  */
24997  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 177, __pyx_L1_error)
24998  __Pyx_GOTREF(__pyx_tuple__11);
24999  __Pyx_GIVEREF(__pyx_tuple__11);
25000 
25001  /* "View.MemoryView":193
25002  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
25003  * if not (flags & bufmode):
25004  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
25005  * info.buf = self.data
25006  * info.len = self.len
25007  */
25008  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 193, __pyx_L1_error)
25009  __Pyx_GOTREF(__pyx_tuple__12);
25010  __Pyx_GIVEREF(__pyx_tuple__12);
25011 
25012  /* "(tree fragment)":2
25013  * def __reduce_cython__(self):
25014  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25015  * def __setstate_cython__(self, __pyx_state):
25016  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25017  */
25018  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error)
25019  __Pyx_GOTREF(__pyx_tuple__13);
25020  __Pyx_GIVEREF(__pyx_tuple__13);
25021 
25022  /* "(tree fragment)":4
25023  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25024  * def __setstate_cython__(self, __pyx_state):
25025  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25026  */
25027  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
25028  __Pyx_GOTREF(__pyx_tuple__14);
25029  __Pyx_GIVEREF(__pyx_tuple__14);
25030 
25031  /* "View.MemoryView":420
25032  * def __setitem__(memoryview self, object index, object value):
25033  * if self.view.readonly:
25034  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
25035  *
25036  * have_slices, index = _unellipsify(index, self.view.ndim)
25037  */
25038  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 420, __pyx_L1_error)
25039  __Pyx_GOTREF(__pyx_tuple__15);
25040  __Pyx_GIVEREF(__pyx_tuple__15);
25041 
25042  /* "View.MemoryView":497
25043  * result = struct.unpack(self.view.format, bytesitem)
25044  * except struct.error:
25045  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
25046  * else:
25047  * if len(self.view.format) == 1:
25048  */
25049  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 497, __pyx_L1_error)
25050  __Pyx_GOTREF(__pyx_tuple__16);
25051  __Pyx_GIVEREF(__pyx_tuple__16);
25052 
25053  /* "View.MemoryView":522
25054  * def __getbuffer__(self, Py_buffer *info, int flags):
25055  * if flags & PyBUF_WRITABLE and self.view.readonly:
25056  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
25057  *
25058  * if flags & PyBUF_ND:
25059  */
25060  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 522, __pyx_L1_error)
25061  __Pyx_GOTREF(__pyx_tuple__17);
25062  __Pyx_GIVEREF(__pyx_tuple__17);
25063 
25064  /* "View.MemoryView":572
25065  * if self.view.strides == NULL:
25066  *
25067  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
25068  *
25069  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
25070  */
25071  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 572, __pyx_L1_error)
25072  __Pyx_GOTREF(__pyx_tuple__18);
25073  __Pyx_GIVEREF(__pyx_tuple__18);
25074 
25075  /* "View.MemoryView":579
25076  * def suboffsets(self):
25077  * if self.view.suboffsets == NULL:
25078  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
25079  *
25080  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
25081  */
25082  __pyx_tuple__19 = PyTuple_New(1); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 579, __pyx_L1_error)
25083  __Pyx_GOTREF(__pyx_tuple__19);
25084  __Pyx_INCREF(__pyx_int_neg_1);
25085  __Pyx_GIVEREF(__pyx_int_neg_1);
25086  PyTuple_SET_ITEM(__pyx_tuple__19, 0, __pyx_int_neg_1);
25087  __Pyx_GIVEREF(__pyx_tuple__19);
25088 
25089  /* "(tree fragment)":2
25090  * def __reduce_cython__(self):
25091  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25092  * def __setstate_cython__(self, __pyx_state):
25093  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25094  */
25095  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
25096  __Pyx_GOTREF(__pyx_tuple__20);
25097  __Pyx_GIVEREF(__pyx_tuple__20);
25098 
25099  /* "(tree fragment)":4
25100  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25101  * def __setstate_cython__(self, __pyx_state):
25102  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25103  */
25104  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
25105  __Pyx_GOTREF(__pyx_tuple__21);
25106  __Pyx_GIVEREF(__pyx_tuple__21);
25107 
25108  /* "View.MemoryView":705
25109  * for suboffset in suboffsets[:ndim]:
25110  * if suboffset >= 0:
25111  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
25112  *
25113  *
25114  */
25115  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 705, __pyx_L1_error)
25116  __Pyx_GOTREF(__pyx_tuple__22);
25117  __Pyx_GIVEREF(__pyx_tuple__22);
25118 
25119  /* "(tree fragment)":2
25120  * def __reduce_cython__(self):
25121  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25122  * def __setstate_cython__(self, __pyx_state):
25123  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25124  */
25125  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
25126  __Pyx_GOTREF(__pyx_tuple__23);
25127  __Pyx_GIVEREF(__pyx_tuple__23);
25128 
25129  /* "(tree fragment)":4
25130  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25131  * def __setstate_cython__(self, __pyx_state):
25132  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25133  */
25134  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
25135  __Pyx_GOTREF(__pyx_tuple__24);
25136  __Pyx_GIVEREF(__pyx_tuple__24);
25137  __pyx_tuple__26 = PyTuple_Pack(3, __pyx_int_184977713, __pyx_int_136983863, __pyx_int_112105877); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
25138  __Pyx_GOTREF(__pyx_tuple__26);
25139  __Pyx_GIVEREF(__pyx_tuple__26);
25140 
25141  /* "imate/traceinv/_hutchinson_method.pyx":37
25142  * # =================
25143  *
25144  * def hutchinson_method( # <<<<<<<<<<<<<<
25145  * A,
25146  * gram=False,
25147  */
25148  __pyx_tuple__27 = PyTuple_Pack(32, __pyx_n_s_A, __pyx_n_s_gram, __pyx_n_s_p, __pyx_n_s_return_info, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_assume_matrix, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_solver_tol, __pyx_n_s_orthogonalize, __pyx_n_s_num_threads, __pyx_n_s_verbose, __pyx_n_s_plot, __pyx_n_s_square, __pyx_n_s_data_type_name, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_num_outliers, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_processed_samples, __pyx_n_s_num_samples_used, __pyx_n_s_converged, __pyx_n_s_tot_wall_time, __pyx_n_s_alg_wall_time, __pyx_n_s_cpu_proc_time, __pyx_n_s_info); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 37, __pyx_L1_error)
25149  __Pyx_GOTREF(__pyx_tuple__27);
25150  __Pyx_GIVEREF(__pyx_tuple__27);
25151  __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(18, 0, 32, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_hutchinson_method, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 37, __pyx_L1_error)
25152  __pyx_tuple__28 = PyTuple_Pack(17, ((PyObject *)Py_False), ((PyObject *)__pyx_int_1), ((PyObject *)Py_False), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject*)__pyx_n_u_gen), ((PyObject *)__pyx_int_10), ((PyObject *)__pyx_int_50), ((PyObject *)Py_None), ((PyObject*)__pyx_float_1eneg_2), ((PyObject*)__pyx_float_0_95), ((PyObject*)__pyx_float_0_001), ((PyObject*)__pyx_float_1eneg_6), ((PyObject *)Py_True), ((PyObject *)__pyx_int_0), ((PyObject *)Py_False), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 37, __pyx_L1_error)
25153  __Pyx_GOTREF(__pyx_tuple__28);
25154  __Pyx_GIVEREF(__pyx_tuple__28);
25155 
25156  /* "imate/traceinv/_hutchinson_method.pyx":722
25157  * # =======================
25158  *
25159  * def _hutchinson_method_float( # <<<<<<<<<<<<<<
25160  * A,
25161  * B,
25162  */
25163  __pyx_tuple__29 = PyTuple_Pack(35, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_gram, __pyx_n_s_p, __pyx_n_s_assume_matrix, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_solver_tol, __pyx_n_s_orthogonalize, __pyx_n_s_num_threads, __pyx_n_s_vector_size, __pyx_n_s_E, __pyx_n_s_memoryview_E, __pyx_n_s_cE, __pyx_n_s_init_tot_wall_time, __pyx_n_s_init_cpu_proc_time, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_processed_samples, __pyx_n_s_num_samples_used, __pyx_n_s_converged, __pyx_n_s_init_alg_wall_time, __pyx_n_s_AtA, __pyx_n_s_i, __pyx_n_s_alg_wall_time, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_num_outliers, __pyx_n_s_tot_wall_time, __pyx_n_s_cpu_proc_time); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 722, __pyx_L1_error)
25164  __Pyx_GOTREF(__pyx_tuple__29);
25165  __Pyx_GIVEREF(__pyx_tuple__29);
25166  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(15, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_hutchinson_method_float, 722, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 722, __pyx_L1_error)
25167 
25168  /* "imate/traceinv/_hutchinson_method.pyx":818
25169  * # ========================
25170  *
25171  * def _hutchinson_method_double( # <<<<<<<<<<<<<<
25172  * A,
25173  * B,
25174  */
25175  __pyx_tuple__30 = PyTuple_Pack(35, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C, __pyx_n_s_gram, __pyx_n_s_p, __pyx_n_s_assume_matrix, __pyx_n_s_min_num_samples, __pyx_n_s_max_num_samples, __pyx_n_s_error_atol, __pyx_n_s_error_rtol, __pyx_n_s_confidence_level, __pyx_n_s_outlier_significance_level, __pyx_n_s_solver_tol, __pyx_n_s_orthogonalize, __pyx_n_s_num_threads, __pyx_n_s_vector_size, __pyx_n_s_E, __pyx_n_s_memoryview_E, __pyx_n_s_cE, __pyx_n_s_init_tot_wall_time, __pyx_n_s_init_cpu_proc_time, __pyx_n_s_samples, __pyx_n_s_processed_samples_indices, __pyx_n_s_num_processed_samples, __pyx_n_s_num_samples_used, __pyx_n_s_converged, __pyx_n_s_init_alg_wall_time, __pyx_n_s_AtA, __pyx_n_s_i, __pyx_n_s_alg_wall_time, __pyx_n_s_trace, __pyx_n_s_error, __pyx_n_s_num_outliers, __pyx_n_s_tot_wall_time, __pyx_n_s_cpu_proc_time); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 818, __pyx_L1_error)
25176  __Pyx_GOTREF(__pyx_tuple__30);
25177  __Pyx_GIVEREF(__pyx_tuple__30);
25178  __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(15, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_hutchinson_method_double, 818, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 818, __pyx_L1_error)
25179 
25180  /* "imate/traceinv/_hutchinson_method.pyx":1072
25181  * # ============
25182  *
25183  * def _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E): # <<<<<<<<<<<<<<
25184  * """
25185  * Computes either of the followings:
25186  */
25187  __pyx_tuple__31 = PyTuple_Pack(12, __pyx_n_s_A, __pyx_n_s_AtA, __pyx_n_s_p, __pyx_n_s_gram, __pyx_n_s_assume_matrix, __pyx_n_s_solver_tol, __pyx_n_s_B, __pyx_n_s_E, __pyx_n_s_BE, __pyx_n_s_OpE, __pyx_n_s_i, __pyx_n_s_AinvpE); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1072, __pyx_L1_error)
25188  __Pyx_GOTREF(__pyx_tuple__31);
25189  __Pyx_GIVEREF(__pyx_tuple__31);
25190  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(8, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate_traceinv__hutchinson_metho, __pyx_n_s_operator_dot, 1072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 1072, __pyx_L1_error)
25191 
25192  /* "View.MemoryView":287
25193  * return self.name
25194  *
25195  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
25196  * cdef strided = Enum("<strided and direct>") # default
25197  * cdef indirect = Enum("<strided and indirect>")
25198  */
25199  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 287, __pyx_L1_error)
25200  __Pyx_GOTREF(__pyx_tuple__32);
25201  __Pyx_GIVEREF(__pyx_tuple__32);
25202 
25203  /* "View.MemoryView":288
25204  *
25205  * cdef generic = Enum("<strided and direct or indirect>")
25206  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
25207  * cdef indirect = Enum("<strided and indirect>")
25208  *
25209  */
25210  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 288, __pyx_L1_error)
25211  __Pyx_GOTREF(__pyx_tuple__33);
25212  __Pyx_GIVEREF(__pyx_tuple__33);
25213 
25214  /* "View.MemoryView":289
25215  * cdef generic = Enum("<strided and direct or indirect>")
25216  * cdef strided = Enum("<strided and direct>") # default
25217  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
25218  *
25219  *
25220  */
25221  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 289, __pyx_L1_error)
25222  __Pyx_GOTREF(__pyx_tuple__34);
25223  __Pyx_GIVEREF(__pyx_tuple__34);
25224 
25225  /* "View.MemoryView":292
25226  *
25227  *
25228  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
25229  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
25230  *
25231  */
25232  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 292, __pyx_L1_error)
25233  __Pyx_GOTREF(__pyx_tuple__35);
25234  __Pyx_GIVEREF(__pyx_tuple__35);
25235 
25236  /* "View.MemoryView":293
25237  *
25238  * cdef contiguous = Enum("<contiguous and direct>")
25239  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
25240  *
25241  *
25242  */
25243  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 293, __pyx_L1_error)
25244  __Pyx_GOTREF(__pyx_tuple__36);
25245  __Pyx_GIVEREF(__pyx_tuple__36);
25246 
25247  /* "(tree fragment)":1
25248  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
25249  * cdef object __pyx_PickleError
25250  * cdef object __pyx_result
25251  */
25252  __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error)
25253  __Pyx_GOTREF(__pyx_tuple__37);
25254  __Pyx_GIVEREF(__pyx_tuple__37);
25255  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 1, __pyx_L1_error)
25256  __Pyx_RefNannyFinishContext();
25257  return 0;
25258  __pyx_L1_error:;
25259  __Pyx_RefNannyFinishContext();
25260  return -1;
25261 }
25262 
25263 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
25264  /* AssertionsEnabled.init */
25265  __Pyx_init_assertions_enabled();
25266 
25267 if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
25268 
25269  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25270  __pyx_float_0_95 = PyFloat_FromDouble(0.95); if (unlikely(!__pyx_float_0_95)) __PYX_ERR(0, 1, __pyx_L1_error)
25271  __pyx_float_1eneg_2 = PyFloat_FromDouble(1e-2); if (unlikely(!__pyx_float_1eneg_2)) __PYX_ERR(0, 1, __pyx_L1_error)
25272  __pyx_float_1eneg_6 = PyFloat_FromDouble(1e-6); if (unlikely(!__pyx_float_1eneg_6)) __PYX_ERR(0, 1, __pyx_L1_error)
25273  __pyx_float_0_001 = PyFloat_FromDouble(0.001); if (unlikely(!__pyx_float_0_001)) __PYX_ERR(0, 1, __pyx_L1_error)
25274  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
25275  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25276  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
25277  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error)
25278  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
25279  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
25280  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
25281  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25282  return 0;
25283  __pyx_L1_error:;
25284  return -1;
25285 }
25286 
25287 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
25288 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
25289 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
25290 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
25291 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
25292 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
25293 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
25294 
25295 static int __Pyx_modinit_global_init_code(void) {
25296  __Pyx_RefNannyDeclarations
25297  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
25298  /*--- Global init code ---*/
25299  generic = Py_None; Py_INCREF(Py_None);
25300  strided = Py_None; Py_INCREF(Py_None);
25301  indirect = Py_None; Py_INCREF(Py_None);
25302  contiguous = Py_None; Py_INCREF(Py_None);
25303  indirect_contiguous = Py_None; Py_INCREF(Py_None);
25304  __Pyx_RefNannyFinishContext();
25305  return 0;
25306 }
25307 
25308 static int __Pyx_modinit_variable_export_code(void) {
25309  __Pyx_RefNannyDeclarations
25310  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
25311  /*--- Variable export code ---*/
25312  __Pyx_RefNannyFinishContext();
25313  return 0;
25314 }
25315 
25316 static int __Pyx_modinit_function_export_code(void) {
25317  __Pyx_RefNannyDeclarations
25318  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
25319  /*--- Function export code ---*/
25320  __Pyx_RefNannyFinishContext();
25321  return 0;
25322 }
25323 
25324 static int __Pyx_modinit_type_init_code(void) {
25325  __Pyx_RefNannyDeclarations
25326  int __pyx_lineno = 0;
25327  const char *__pyx_filename = NULL;
25328  int __pyx_clineno = 0;
25329  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
25330  /*--- Type init code ---*/
25331  __pyx_vtabptr_array = &__pyx_vtable_array;
25332  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
25333  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
25334  #if PY_VERSION_HEX < 0x030800B1
25335  __pyx_type___pyx_array.tp_print = 0;
25336  #endif
25337  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
25338  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 106, __pyx_L1_error)
25339  __pyx_array_type = &__pyx_type___pyx_array;
25340  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
25341  #if PY_VERSION_HEX < 0x030800B1
25342  __pyx_type___pyx_MemviewEnum.tp_print = 0;
25343  #endif
25344  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
25345  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25346  }
25347  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 280, __pyx_L1_error)
25348  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
25349  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
25350  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
25351  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
25352  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
25353  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
25354  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
25355  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
25356  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
25357  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
25358  #if PY_VERSION_HEX < 0x030800B1
25359  __pyx_type___pyx_memoryview.tp_print = 0;
25360  #endif
25361  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
25362  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25363  }
25364  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
25365  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 331, __pyx_L1_error)
25366  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
25367  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
25368  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
25369  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
25370  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
25371  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
25372  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
25373  #if PY_VERSION_HEX < 0x030800B1
25374  __pyx_type___pyx_memoryviewslice.tp_print = 0;
25375  #endif
25376  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
25377  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
25378  }
25379  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
25380  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 967, __pyx_L1_error)
25381  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
25382  __Pyx_RefNannyFinishContext();
25383  return 0;
25384  __pyx_L1_error:;
25385  __Pyx_RefNannyFinishContext();
25386  return -1;
25387 }
25388 
25389 static int __Pyx_modinit_type_import_code(void) {
25390  __Pyx_RefNannyDeclarations
25391  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
25392  /*--- Type import code ---*/
25393  __Pyx_RefNannyFinishContext();
25394  return 0;
25395 }
25396 
25397 static int __Pyx_modinit_variable_import_code(void) {
25398  __Pyx_RefNannyDeclarations
25399  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
25400  /*--- Variable import code ---*/
25401  __Pyx_RefNannyFinishContext();
25402  return 0;
25403 }
25404 
25405 static int __Pyx_modinit_function_import_code(void) {
25406  __Pyx_RefNannyDeclarations
25407  PyObject *__pyx_t_1 = NULL;
25408  int __pyx_lineno = 0;
25409  const char *__pyx_filename = NULL;
25410  int __pyx_clineno = 0;
25411  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
25412  /*--- Function import code ---*/
25413  __pyx_t_1 = PyImport_ImportModule("imate._linear_algebra.orthogonalization"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
25414  __Pyx_GOTREF(__pyx_t_1);
25415  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "__pyx_fuse_0orthogonalize_vectors", (void (**)(void))&__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors, "void (float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25416  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "__pyx_fuse_1orthogonalize_vectors", (void (**)(void))&__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors, "void (double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25417  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "__pyx_fuse_2orthogonalize_vectors", (void (**)(void))&__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_17orthogonalization_orthogonalize_vectors, "void (long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25418  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25419  __pyx_t_1 = PyImport_ImportModule("imate._linear_algebra.random_vectors"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
25420  __Pyx_GOTREF(__pyx_t_1);
25421  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "__pyx_fuse_0generate_random_column_vectors", (void (**)(void))&__pyx_fuse_0__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors, "void (float *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25422  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "__pyx_fuse_1generate_random_column_vectors", (void (**)(void))&__pyx_fuse_1__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors, "void (double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25423  if (__Pyx_ImportFunction_0_29_36(__pyx_t_1, "__pyx_fuse_2generate_random_column_vectors", (void (**)(void))&__pyx_fuse_2__pyx_f_5imate_15_linear_algebra_14random_vectors_generate_random_column_vectors, "void (long double *, __pyx_t_5imate_12_definitions_5types_LongIndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const , __pyx_t_5imate_12_definitions_5types_IndexType const )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25424  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25425  __Pyx_RefNannyFinishContext();
25426  return 0;
25427  __pyx_L1_error:;
25428  __Pyx_XDECREF(__pyx_t_1);
25429  __Pyx_RefNannyFinishContext();
25430  return -1;
25431 }
25432 
25433 
25434 #ifndef CYTHON_NO_PYINIT_EXPORT
25435 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
25436 #elif PY_MAJOR_VERSION < 3
25437 #ifdef __cplusplus
25438 #define __Pyx_PyMODINIT_FUNC extern "C" void
25439 #else
25440 #define __Pyx_PyMODINIT_FUNC void
25441 #endif
25442 #else
25443 #ifdef __cplusplus
25444 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
25445 #else
25446 #define __Pyx_PyMODINIT_FUNC PyObject *
25447 #endif
25448 #endif
25449 
25450 
25451 #if PY_MAJOR_VERSION < 3
25452 __Pyx_PyMODINIT_FUNC init_hutchinson_method(void) CYTHON_SMALL_CODE; /*proto*/
25453 __Pyx_PyMODINIT_FUNC init_hutchinson_method(void)
25454 #else
25455 __Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(void) CYTHON_SMALL_CODE; /*proto*/
25456 __Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(void)
25457 #if CYTHON_PEP489_MULTI_PHASE_INIT
25458 {
25459  return PyModuleDef_Init(&__pyx_moduledef);
25460 }
25461 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
25462  #if PY_VERSION_HEX >= 0x030700A1
25463  static PY_INT64_T main_interpreter_id = -1;
25464  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
25465  if (main_interpreter_id == -1) {
25466  main_interpreter_id = current_id;
25467  return (unlikely(current_id == -1)) ? -1 : 0;
25468  } else if (unlikely(main_interpreter_id != current_id))
25469  #else
25470  static PyInterpreterState *main_interpreter = NULL;
25471  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
25472  if (!main_interpreter) {
25473  main_interpreter = current_interpreter;
25474  } else if (unlikely(main_interpreter != current_interpreter))
25475  #endif
25476  {
25477  PyErr_SetString(
25478  PyExc_ImportError,
25479  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
25480  return -1;
25481  }
25482  return 0;
25483 }
25484 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
25485  PyObject *value = PyObject_GetAttrString(spec, from_name);
25486  int result = 0;
25487  if (likely(value)) {
25488  if (allow_none || value != Py_None) {
25489  result = PyDict_SetItemString(moddict, to_name, value);
25490  }
25491  Py_DECREF(value);
25492  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
25493  PyErr_Clear();
25494  } else {
25495  result = -1;
25496  }
25497  return result;
25498 }
25499 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
25500  PyObject *module = NULL, *moddict, *modname;
25501  if (__Pyx_check_single_interpreter())
25502  return NULL;
25503  if (__pyx_m)
25504  return __Pyx_NewRef(__pyx_m);
25505  modname = PyObject_GetAttrString(spec, "name");
25506  if (unlikely(!modname)) goto bad;
25507  module = PyModule_NewObject(modname);
25508  Py_DECREF(modname);
25509  if (unlikely(!module)) goto bad;
25510  moddict = PyModule_GetDict(module);
25511  if (unlikely(!moddict)) goto bad;
25512  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
25513  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
25514  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
25515  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
25516  return module;
25517 bad:
25518  Py_XDECREF(module);
25519  return NULL;
25520 }
25521 
25522 
25523 static CYTHON_SMALL_CODE int __pyx_pymod_exec__hutchinson_method(PyObject *__pyx_pyinit_module)
25524 #endif
25525 #endif
25526 {
25527  __Pyx_TraceDeclarations
25528  PyObject *__pyx_t_1 = NULL;
25529  PyObject *__pyx_t_2 = NULL;
25530  static PyThread_type_lock __pyx_t_3[8];
25531  int __pyx_lineno = 0;
25532  const char *__pyx_filename = NULL;
25533  int __pyx_clineno = 0;
25534  __Pyx_RefNannyDeclarations
25535  #if CYTHON_PEP489_MULTI_PHASE_INIT
25536  if (__pyx_m) {
25537  if (__pyx_m == __pyx_pyinit_module) return 0;
25538  PyErr_SetString(PyExc_RuntimeError, "Module '_hutchinson_method' has already been imported. Re-initialisation is not supported.");
25539  return -1;
25540  }
25541  #elif PY_MAJOR_VERSION >= 3
25542  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
25543  #endif
25544  #if CYTHON_REFNANNY
25545 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
25546 if (!__Pyx_RefNanny) {
25547  PyErr_Clear();
25548  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
25549  if (!__Pyx_RefNanny)
25550  Py_FatalError("failed to import 'refnanny' module");
25551 }
25552 #endif
25553  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(void)", 0);
25554  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25555  #ifdef __Pxy_PyFrame_Initialize_Offsets
25556  __Pxy_PyFrame_Initialize_Offsets();
25557  #endif
25558  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
25559  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
25560  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
25561  #ifdef __Pyx_CyFunction_USED
25562  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25563  #endif
25564  #ifdef __Pyx_FusedFunction_USED
25565  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25566  #endif
25567  #ifdef __Pyx_Coroutine_USED
25568  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25569  #endif
25570  #ifdef __Pyx_Generator_USED
25571  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25572  #endif
25573  #ifdef __Pyx_AsyncGen_USED
25574  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25575  #endif
25576  #ifdef __Pyx_StopAsyncIteration_USED
25577  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25578  #endif
25579  /*--- Library function declarations ---*/
25580  /*--- Threads initialization code ---*/
25581  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
25582  PyEval_InitThreads();
25583  #endif
25584  /*--- Module creation code ---*/
25585  #if CYTHON_PEP489_MULTI_PHASE_INIT
25586  __pyx_m = __pyx_pyinit_module;
25587  Py_INCREF(__pyx_m);
25588  #else
25589  #if PY_MAJOR_VERSION < 3
25590  __pyx_m = Py_InitModule4("_hutchinson_method", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
25591  #else
25592  __pyx_m = PyModule_Create(&__pyx_moduledef);
25593  #endif
25594  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
25595  #endif
25596  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
25597  Py_INCREF(__pyx_d);
25598  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
25599  Py_INCREF(__pyx_b);
25600  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
25601  Py_INCREF(__pyx_cython_runtime);
25602  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25603  /*--- Initialize various global constants etc. ---*/
25604  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25605  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
25606  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25607  #endif
25608  if (__pyx_module_is_main_imate__traceinv___hutchinson_method) {
25609  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25610  }
25611  #if PY_MAJOR_VERSION >= 3
25612  {
25613  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
25614  if (!PyDict_GetItemString(modules, "imate.traceinv._hutchinson_method")) {
25615  if (unlikely(PyDict_SetItemString(modules, "imate.traceinv._hutchinson_method", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
25616  }
25617  }
25618  #endif
25619  /*--- Builtin init code ---*/
25620  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25621  /*--- Constants init code ---*/
25622  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25623  /*--- Global type/function init code ---*/
25624  (void)__Pyx_modinit_global_init_code();
25625  (void)__Pyx_modinit_variable_export_code();
25626  (void)__Pyx_modinit_function_export_code();
25627  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
25628  (void)__Pyx_modinit_type_import_code();
25629  (void)__Pyx_modinit_variable_import_code();
25630  if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
25631  /*--- Execution code ---*/
25632  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
25633  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25634  #endif
25635  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit__hutchinson_method(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
25636 
25637  /* "imate/traceinv/_hutchinson_method.pyx":15
25638  *
25639  * # Python
25640  * import time # <<<<<<<<<<<<<<
25641  * import numpy
25642  * import scipy.sparse
25643  */
25644  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
25645  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
25646  __Pyx_GOTREF(__pyx_t_1);
25647  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
25648  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25649 
25650  /* "imate/traceinv/_hutchinson_method.pyx":16
25651  * # Python
25652  * import time
25653  * import numpy # <<<<<<<<<<<<<<
25654  * import scipy.sparse
25655  * from scipy.sparse import isspmatrix
25656  */
25657  __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
25658  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
25659  __Pyx_GOTREF(__pyx_t_1);
25660  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
25661  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25662 
25663  /* "imate/traceinv/_hutchinson_method.pyx":17
25664  * import time
25665  * import numpy
25666  * import scipy.sparse # <<<<<<<<<<<<<<
25667  * from scipy.sparse import isspmatrix
25668  * import multiprocessing
25669  */
25670  __Pyx_TraceLine(17,0,__PYX_ERR(0, 17, __pyx_L1_error))
25671  __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy_sparse, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
25672  __Pyx_GOTREF(__pyx_t_1);
25673  if (PyDict_SetItem(__pyx_d, __pyx_n_s_scipy, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
25674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25675 
25676  /* "imate/traceinv/_hutchinson_method.pyx":18
25677  * import numpy
25678  * import scipy.sparse
25679  * from scipy.sparse import isspmatrix # <<<<<<<<<<<<<<
25680  * import multiprocessing
25681  * from ..__version__ import __version__
25682  */
25683  __Pyx_TraceLine(18,0,__PYX_ERR(0, 18, __pyx_L1_error))
25684  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
25685  __Pyx_GOTREF(__pyx_t_1);
25686  __Pyx_INCREF(__pyx_n_s_isspmatrix);
25687  __Pyx_GIVEREF(__pyx_n_s_isspmatrix);
25688  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_isspmatrix);
25689  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
25690  __Pyx_GOTREF(__pyx_t_2);
25691  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25692  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
25693  __Pyx_GOTREF(__pyx_t_1);
25694  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
25695  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25696  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25697 
25698  /* "imate/traceinv/_hutchinson_method.pyx":19
25699  * import scipy.sparse
25700  * from scipy.sparse import isspmatrix
25701  * import multiprocessing # <<<<<<<<<<<<<<
25702  * from ..__version__ import __version__
25703  * from .._linear_algebra import linear_solver
25704  */
25705  __Pyx_TraceLine(19,0,__PYX_ERR(0, 19, __pyx_L1_error))
25706  __pyx_t_2 = __Pyx_Import(__pyx_n_s_multiprocessing, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
25707  __Pyx_GOTREF(__pyx_t_2);
25708  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multiprocessing, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
25709  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25710 
25711  /* "imate/traceinv/_hutchinson_method.pyx":20
25712  * from scipy.sparse import isspmatrix
25713  * import multiprocessing
25714  * from ..__version__ import __version__ # <<<<<<<<<<<<<<
25715  * from .._linear_algebra import linear_solver
25716  * from ._convergence_tools import check_convergence, average_estimates
25717  */
25718  __Pyx_TraceLine(20,0,__PYX_ERR(0, 20, __pyx_L1_error))
25719  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
25720  __Pyx_GOTREF(__pyx_t_2);
25721  __Pyx_INCREF(__pyx_n_s_version_2);
25722  __Pyx_GIVEREF(__pyx_n_s_version_2);
25723  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_version_2);
25724  __pyx_t_1 = __Pyx_Import(__pyx_n_s_version_2, __pyx_t_2, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
25725  __Pyx_GOTREF(__pyx_t_1);
25726  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25727  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_version_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
25728  __Pyx_GOTREF(__pyx_t_2);
25729  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version_2, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
25730  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25731  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25732 
25733  /* "imate/traceinv/_hutchinson_method.pyx":21
25734  * import multiprocessing
25735  * from ..__version__ import __version__
25736  * from .._linear_algebra import linear_solver # <<<<<<<<<<<<<<
25737  * from ._convergence_tools import check_convergence, average_estimates
25738  * from .._trace_estimator.trace_estimator_plot_utilities import plot_convergence
25739  */
25740  __Pyx_TraceLine(21,0,__PYX_ERR(0, 21, __pyx_L1_error))
25741  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
25742  __Pyx_GOTREF(__pyx_t_1);
25743  __Pyx_INCREF(__pyx_n_s_linear_solver);
25744  __Pyx_GIVEREF(__pyx_n_s_linear_solver);
25745  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_linear_solver);
25746  __pyx_t_2 = __Pyx_Import(__pyx_n_s_linear_algebra, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
25747  __Pyx_GOTREF(__pyx_t_2);
25748  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25749  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_linear_solver); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
25750  __Pyx_GOTREF(__pyx_t_1);
25751  if (PyDict_SetItem(__pyx_d, __pyx_n_s_linear_solver, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
25752  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25753  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25754 
25755  /* "imate/traceinv/_hutchinson_method.pyx":22
25756  * from ..__version__ import __version__
25757  * from .._linear_algebra import linear_solver
25758  * from ._convergence_tools import check_convergence, average_estimates # <<<<<<<<<<<<<<
25759  * from .._trace_estimator.trace_estimator_plot_utilities import plot_convergence
25760  * from ._hutchinson_method_utilities import check_arguments, print_summary
25761  */
25762  __Pyx_TraceLine(22,0,__PYX_ERR(0, 22, __pyx_L1_error))
25763  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
25764  __Pyx_GOTREF(__pyx_t_2);
25765  __Pyx_INCREF(__pyx_n_s_check_convergence);
25766  __Pyx_GIVEREF(__pyx_n_s_check_convergence);
25767  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_check_convergence);
25768  __Pyx_INCREF(__pyx_n_s_average_estimates);
25769  __Pyx_GIVEREF(__pyx_n_s_average_estimates);
25770  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_average_estimates);
25771  __pyx_t_1 = __Pyx_Import(__pyx_n_s_convergence_tools, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
25772  __Pyx_GOTREF(__pyx_t_1);
25773  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25774  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_check_convergence); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
25775  __Pyx_GOTREF(__pyx_t_2);
25776  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_convergence, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
25777  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25778  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_average_estimates); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
25779  __Pyx_GOTREF(__pyx_t_2);
25780  if (PyDict_SetItem(__pyx_d, __pyx_n_s_average_estimates, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
25781  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25782  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25783 
25784  /* "imate/traceinv/_hutchinson_method.pyx":23
25785  * from .._linear_algebra import linear_solver
25786  * from ._convergence_tools import check_convergence, average_estimates
25787  * from .._trace_estimator.trace_estimator_plot_utilities import plot_convergence # <<<<<<<<<<<<<<
25788  * from ._hutchinson_method_utilities import check_arguments, print_summary
25789  * from .._linear_algebra.matrix_utilities import get_data_type_name, get_nnz, \
25790  */
25791  __Pyx_TraceLine(23,0,__PYX_ERR(0, 23, __pyx_L1_error))
25792  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
25793  __Pyx_GOTREF(__pyx_t_1);
25794  __Pyx_INCREF(__pyx_n_s_plot_convergence);
25795  __Pyx_GIVEREF(__pyx_n_s_plot_convergence);
25796  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_plot_convergence);
25797  __pyx_t_2 = __Pyx_Import(__pyx_n_s_trace_estimator_trace_estimator, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
25798  __Pyx_GOTREF(__pyx_t_2);
25799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25800  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_plot_convergence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
25801  __Pyx_GOTREF(__pyx_t_1);
25802  if (PyDict_SetItem(__pyx_d, __pyx_n_s_plot_convergence, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
25803  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25804  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25805 
25806  /* "imate/traceinv/_hutchinson_method.pyx":24
25807  * from ._convergence_tools import check_convergence, average_estimates
25808  * from .._trace_estimator.trace_estimator_plot_utilities import plot_convergence
25809  * from ._hutchinson_method_utilities import check_arguments, print_summary # <<<<<<<<<<<<<<
25810  * from .._linear_algebra.matrix_utilities import get_data_type_name, get_nnz, \
25811  * get_density
25812  */
25813  __Pyx_TraceLine(24,0,__PYX_ERR(0, 24, __pyx_L1_error))
25814  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
25815  __Pyx_GOTREF(__pyx_t_2);
25816  __Pyx_INCREF(__pyx_n_s_check_arguments);
25817  __Pyx_GIVEREF(__pyx_n_s_check_arguments);
25818  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_check_arguments);
25819  __Pyx_INCREF(__pyx_n_s_print_summary);
25820  __Pyx_GIVEREF(__pyx_n_s_print_summary);
25821  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_print_summary);
25822  __pyx_t_1 = __Pyx_Import(__pyx_n_s_hutchinson_method_utilities, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
25823  __Pyx_GOTREF(__pyx_t_1);
25824  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25825  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_check_arguments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
25826  __Pyx_GOTREF(__pyx_t_2);
25827  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_arguments, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
25828  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25829  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_print_summary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
25830  __Pyx_GOTREF(__pyx_t_2);
25831  if (PyDict_SetItem(__pyx_d, __pyx_n_s_print_summary, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
25832  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25833  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25834 
25835  /* "imate/traceinv/_hutchinson_method.pyx":25
25836  * from .._trace_estimator.trace_estimator_plot_utilities import plot_convergence
25837  * from ._hutchinson_method_utilities import check_arguments, print_summary
25838  * from .._linear_algebra.matrix_utilities import get_data_type_name, get_nnz, \ # <<<<<<<<<<<<<<
25839  * get_density
25840  *
25841  */
25842  __Pyx_TraceLine(25,0,__PYX_ERR(0, 25, __pyx_L1_error))
25843  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25844  __Pyx_GOTREF(__pyx_t_1);
25845  __Pyx_INCREF(__pyx_n_s_get_data_type_name);
25846  __Pyx_GIVEREF(__pyx_n_s_get_data_type_name);
25847  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_data_type_name);
25848  __Pyx_INCREF(__pyx_n_s_get_nnz);
25849  __Pyx_GIVEREF(__pyx_n_s_get_nnz);
25850  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_nnz);
25851  __Pyx_INCREF(__pyx_n_s_get_density);
25852  __Pyx_GIVEREF(__pyx_n_s_get_density);
25853  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_get_density);
25854  __pyx_t_2 = __Pyx_Import(__pyx_n_s_linear_algebra_matrix_utilities, __pyx_t_1, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
25855  __Pyx_GOTREF(__pyx_t_2);
25856  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25857  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_data_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25858  __Pyx_GOTREF(__pyx_t_1);
25859  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_data_type_name, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
25860  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25861  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_nnz); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25862  __Pyx_GOTREF(__pyx_t_1);
25863  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_nnz, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
25864  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25865  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_density); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
25866  __Pyx_GOTREF(__pyx_t_1);
25867  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_density, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
25868  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25869  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25870 
25871  /* "imate/traceinv/_hutchinson_method.pyx":37
25872  * # =================
25873  *
25874  * def hutchinson_method( # <<<<<<<<<<<<<<
25875  * A,
25876  * gram=False,
25877  */
25878  __Pyx_TraceLine(37,0,__PYX_ERR(0, 37, __pyx_L1_error))
25879  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_1hutchinson_method, 0, __pyx_n_s_hutchinson_method, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
25880  __Pyx_GOTREF(__pyx_t_2);
25881  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__28);
25882  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hutchinson_method, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
25883  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25884 
25885  /* "imate/traceinv/_hutchinson_method.pyx":722
25886  * # =======================
25887  *
25888  * def _hutchinson_method_float( # <<<<<<<<<<<<<<
25889  * A,
25890  * B,
25891  */
25892  __Pyx_TraceLine(722,0,__PYX_ERR(0, 722, __pyx_L1_error))
25893  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_3_hutchinson_method_float, 0, __pyx_n_s_hutchinson_method_float, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
25894  __Pyx_GOTREF(__pyx_t_2);
25895  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hutchinson_method_float, __pyx_t_2) < 0) __PYX_ERR(0, 722, __pyx_L1_error)
25896  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25897 
25898  /* "imate/traceinv/_hutchinson_method.pyx":818
25899  * # ========================
25900  *
25901  * def _hutchinson_method_double( # <<<<<<<<<<<<<<
25902  * A,
25903  * B,
25904  */
25905  __Pyx_TraceLine(818,0,__PYX_ERR(0, 818, __pyx_L1_error))
25906  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_5_hutchinson_method_double, 0, __pyx_n_s_hutchinson_method_double, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 818, __pyx_L1_error)
25907  __Pyx_GOTREF(__pyx_t_2);
25908  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hutchinson_method_double, __pyx_t_2) < 0) __PYX_ERR(0, 818, __pyx_L1_error)
25909  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25910 
25911  /* "imate/traceinv/_hutchinson_method.pyx":914
25912  * # ================================
25913  *
25914  * cdef float _stochastic_trace_estimator_float( # <<<<<<<<<<<<<<
25915  * A,
25916  * AtA,
25917  */
25918  __Pyx_TraceLine(914,0,__PYX_ERR(0, 914, __pyx_L1_error))
25919 
25920 
25921  /* "imate/traceinv/_hutchinson_method.pyx":993
25922  * # =================================
25923  *
25924  * cdef double _stochastic_trace_estimator_double( # <<<<<<<<<<<<<<
25925  * A,
25926  * AtA,
25927  */
25928  __Pyx_TraceLine(993,0,__PYX_ERR(0, 993, __pyx_L1_error))
25929 
25930 
25931  /* "imate/traceinv/_hutchinson_method.pyx":1072
25932  * # ============
25933  *
25934  * def _operator_dot(A, AtA, p, gram, assume_matrix, solver_tol, B, E): # <<<<<<<<<<<<<<
25935  * """
25936  * Computes either of the followings:
25937  */
25938  __Pyx_TraceLine(1072,0,__PYX_ERR(0, 1072, __pyx_L1_error))
25939  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_8traceinv_18_hutchinson_method_7_operator_dot, 0, __pyx_n_s_operator_dot, NULL, __pyx_n_s_imate_traceinv__hutchinson_metho_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
25940  __Pyx_GOTREF(__pyx_t_2);
25941  if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator_dot, __pyx_t_2) < 0) __PYX_ERR(0, 1072, __pyx_L1_error)
25942  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25943 
25944  /* "imate/traceinv/_hutchinson_method.pyx":1
25945  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
25946  * # SPDX-License-Identifier: BSD-3-Clause
25947  * # SPDX-FileType: SOURCE
25948  */
25949  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
25950  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
25951  __Pyx_GOTREF(__pyx_t_2);
25952  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_hutchinson_method_line_37, __pyx_kp_u_Trace_of_matrix_or_linear_opera) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25953  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25954  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25955 
25956  /* "View.MemoryView":210
25957  * info.obj = self
25958  *
25959  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
25960  *
25961  * def __dealloc__(array self):
25962  */
25963  __Pyx_TraceLine(210,0,__PYX_ERR(1, 210, __pyx_L1_error))
25964  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 210, __pyx_L1_error)
25965  __Pyx_GOTREF(__pyx_t_2);
25966  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 210, __pyx_L1_error)
25967  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25968  PyType_Modified(__pyx_array_type);
25969 
25970  /* "View.MemoryView":227
25971  *
25972  * @cname('get_memview')
25973  * cdef get_memview(self): # <<<<<<<<<<<<<<
25974  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
25975  * return memoryview(self, flags, self.dtype_is_object)
25976  */
25977  __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
25978 
25979 
25980  /* "View.MemoryView":245
25981  *
25982  * @cname("__pyx_array_new")
25983  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
25984  * char *mode, char *buf):
25985  * cdef array result
25986  */
25987  __Pyx_TraceLine(245,0,__PYX_ERR(1, 245, __pyx_L1_error))
25988 
25989 
25990  /* "View.MemoryView":287
25991  * return self.name
25992  *
25993  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
25994  * cdef strided = Enum("<strided and direct>") # default
25995  * cdef indirect = Enum("<strided and indirect>")
25996  */
25997  __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
25998  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
25999  __Pyx_GOTREF(__pyx_t_2);
26000  __Pyx_XGOTREF(generic);
26001  __Pyx_DECREF_SET(generic, __pyx_t_2);
26002  __Pyx_GIVEREF(__pyx_t_2);
26003  __pyx_t_2 = 0;
26004 
26005  /* "View.MemoryView":288
26006  *
26007  * cdef generic = Enum("<strided and direct or indirect>")
26008  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
26009  * cdef indirect = Enum("<strided and indirect>")
26010  *
26011  */
26012  __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
26013  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
26014  __Pyx_GOTREF(__pyx_t_2);
26015  __Pyx_XGOTREF(strided);
26016  __Pyx_DECREF_SET(strided, __pyx_t_2);
26017  __Pyx_GIVEREF(__pyx_t_2);
26018  __pyx_t_2 = 0;
26019 
26020  /* "View.MemoryView":289
26021  * cdef generic = Enum("<strided and direct or indirect>")
26022  * cdef strided = Enum("<strided and direct>") # default
26023  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
26024  *
26025  *
26026  */
26027  __Pyx_TraceLine(289,0,__PYX_ERR(1, 289, __pyx_L1_error))
26028  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
26029  __Pyx_GOTREF(__pyx_t_2);
26030  __Pyx_XGOTREF(indirect);
26031  __Pyx_DECREF_SET(indirect, __pyx_t_2);
26032  __Pyx_GIVEREF(__pyx_t_2);
26033  __pyx_t_2 = 0;
26034 
26035  /* "View.MemoryView":292
26036  *
26037  *
26038  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
26039  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
26040  *
26041  */
26042  __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
26043  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
26044  __Pyx_GOTREF(__pyx_t_2);
26045  __Pyx_XGOTREF(contiguous);
26046  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
26047  __Pyx_GIVEREF(__pyx_t_2);
26048  __pyx_t_2 = 0;
26049 
26050  /* "View.MemoryView":293
26051  *
26052  * cdef contiguous = Enum("<contiguous and direct>")
26053  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
26054  *
26055  *
26056  */
26057  __Pyx_TraceLine(293,0,__PYX_ERR(1, 293, __pyx_L1_error))
26058  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 293, __pyx_L1_error)
26059  __Pyx_GOTREF(__pyx_t_2);
26060  __Pyx_XGOTREF(indirect_contiguous);
26061  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
26062  __Pyx_GIVEREF(__pyx_t_2);
26063  __pyx_t_2 = 0;
26064 
26065  /* "View.MemoryView":299
26066  *
26067  * @cname('__pyx_align_pointer')
26068  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
26069  * "Align pointer memory on a given boundary"
26070  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
26071  */
26072  __Pyx_TraceLine(299,0,__PYX_ERR(1, 299, __pyx_L1_error))
26073 
26074 
26075  /* "View.MemoryView":317
26076  *
26077  * DEF THREAD_LOCKS_PREALLOCATED = 8
26078  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
26079  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
26080  * PyThread_allocate_lock(),
26081  */
26082  __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
26083  __pyx_memoryview_thread_locks_used = 0;
26084 
26085  /* "View.MemoryView":318
26086  * DEF THREAD_LOCKS_PREALLOCATED = 8
26087  * cdef int __pyx_memoryview_thread_locks_used = 0
26088  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
26089  * PyThread_allocate_lock(),
26090  * PyThread_allocate_lock(),
26091  */
26092  __Pyx_TraceLine(318,0,__PYX_ERR(1, 318, __pyx_L1_error))
26093  __pyx_t_3[0] = PyThread_allocate_lock();
26094  __pyx_t_3[1] = PyThread_allocate_lock();
26095  __pyx_t_3[2] = PyThread_allocate_lock();
26096  __pyx_t_3[3] = PyThread_allocate_lock();
26097  __pyx_t_3[4] = PyThread_allocate_lock();
26098  __pyx_t_3[5] = PyThread_allocate_lock();
26099  __pyx_t_3[6] = PyThread_allocate_lock();
26100  __pyx_t_3[7] = PyThread_allocate_lock();
26101  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
26102 
26103  /* "View.MemoryView":395
26104  * PyThread_free_lock(self.lock)
26105  *
26106  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
26107  * cdef Py_ssize_t dim
26108  * cdef char *itemp = <char *> self.view.buf
26109  */
26110  __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
26111 
26112 
26113  /* "View.MemoryView":433
26114  * self.setitem_indexed(index, value)
26115  *
26116  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
26117  * if not isinstance(obj, memoryview):
26118  * try:
26119  */
26120  __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
26121 
26122 
26123  /* "View.MemoryView":443
26124  * return obj
26125  *
26126  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
26127  * cdef __Pyx_memviewslice dst_slice
26128  * cdef __Pyx_memviewslice src_slice
26129  */
26130  __Pyx_TraceLine(443,0,__PYX_ERR(1, 443, __pyx_L1_error))
26131 
26132 
26133  /* "View.MemoryView":451
26134  * src.ndim, dst.ndim, self.dtype_is_object)
26135  *
26136  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
26137  * cdef int array[128]
26138  * cdef void *tmp = NULL
26139  */
26140  __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
26141 
26142 
26143  /* "View.MemoryView":483
26144  * PyMem_Free(tmp)
26145  *
26146  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
26147  * cdef char *itemp = self.get_item_pointer(index)
26148  * self.assign_item_from_object(itemp, value)
26149  */
26150  __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
26151 
26152 
26153  /* "View.MemoryView":487
26154  * self.assign_item_from_object(itemp, value)
26155  *
26156  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
26157  * """Only used if instantiated manually by the user, or if Cython doesn't
26158  * know how to convert the type"""
26159  */
26160  __Pyx_TraceLine(487,0,__PYX_ERR(1, 487, __pyx_L1_error))
26161 
26162 
26163  /* "View.MemoryView":503
26164  * return result
26165  *
26166  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
26167  * """Only used if instantiated manually by the user, or if Cython doesn't
26168  * know how to convert the type"""
26169  */
26170  __Pyx_TraceLine(503,0,__PYX_ERR(1, 503, __pyx_L1_error))
26171 
26172 
26173  /* "View.MemoryView":551
26174  * info.obj = self
26175  *
26176  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
26177  *
26178  *
26179  */
26180  __Pyx_TraceLine(551,0,__PYX_ERR(1, 551, __pyx_L1_error))
26181  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 551, __pyx_L1_error)
26182  __Pyx_GOTREF(__pyx_t_2);
26183  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 551, __pyx_L1_error)
26184  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26185  PyType_Modified(__pyx_memoryview_type);
26186 
26187  /* "View.MemoryView":659
26188  *
26189  * @cname('__pyx_memoryview_new')
26190  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
26191  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
26192  * result.typeinfo = typeinfo
26193  */
26194  __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
26195 
26196 
26197  /* "View.MemoryView":665
26198  *
26199  * @cname('__pyx_memoryview_check')
26200  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
26201  * return isinstance(o, memoryview)
26202  *
26203  */
26204  __Pyx_TraceLine(665,0,__PYX_ERR(1, 665, __pyx_L1_error))
26205 
26206 
26207  /* "View.MemoryView":668
26208  * return isinstance(o, memoryview)
26209  *
26210  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
26211  * """
26212  * Replace all ellipses with full slices and fill incomplete indices with
26213  */
26214  __Pyx_TraceLine(668,0,__PYX_ERR(1, 668, __pyx_L1_error))
26215 
26216 
26217  /* "View.MemoryView":702
26218  * return have_slices or nslices, tuple(result)
26219  *
26220  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
26221  * for suboffset in suboffsets[:ndim]:
26222  * if suboffset >= 0:
26223  */
26224  __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
26225 
26226 
26227  /* "View.MemoryView":712
26228  *
26229  * @cname('__pyx_memview_slice')
26230  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
26231  * cdef int new_ndim = 0, suboffset_dim = -1, dim
26232  * cdef bint negative_step
26233  */
26234  __Pyx_TraceLine(712,0,__PYX_ERR(1, 712, __pyx_L1_error))
26235 
26236 
26237  /* "View.MemoryView":809
26238  *
26239  * @cname('__pyx_memoryview_slice_memviewslice')
26240  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
26241  * __Pyx_memviewslice *dst,
26242  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
26243  */
26244  __Pyx_TraceLine(809,0,__PYX_ERR(1, 809, __pyx_L1_error))
26245 
26246 
26247  /* "View.MemoryView":912
26248  *
26249  * @cname('__pyx_pybuffer_index')
26250  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
26251  * Py_ssize_t dim) except NULL:
26252  * cdef Py_ssize_t shape, stride, suboffset = -1
26253  */
26254  __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
26255 
26256 
26257  /* "View.MemoryView":945
26258  *
26259  * @cname('__pyx_memslice_transpose')
26260  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
26261  * cdef int ndim = memslice.memview.view.ndim
26262  *
26263  */
26264  __Pyx_TraceLine(945,0,__PYX_ERR(1, 945, __pyx_L1_error))
26265 
26266 
26267  /* "View.MemoryView":981
26268  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
26269  *
26270  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
26271  * if self.to_object_func != NULL:
26272  * return self.to_object_func(itemp)
26273  */
26274  __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
26275 
26276 
26277  /* "View.MemoryView":987
26278  * return memoryview.convert_item_to_object(self, itemp)
26279  *
26280  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
26281  * if self.to_dtype_func != NULL:
26282  * self.to_dtype_func(itemp, value)
26283  */
26284  __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
26285 
26286 
26287  /* "View.MemoryView":997
26288  * return self.from_object
26289  *
26290  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
26291  *
26292  *
26293  */
26294  __Pyx_TraceLine(997,0,__PYX_ERR(1, 997, __pyx_L1_error))
26295  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 997, __pyx_L1_error)
26296  __Pyx_GOTREF(__pyx_t_2);
26297  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 997, __pyx_L1_error)
26298  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26299  PyType_Modified(__pyx_memoryviewslice_type);
26300 
26301  /* "View.MemoryView":1001
26302  *
26303  * @cname('__pyx_memoryview_fromslice')
26304  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
26305  * int ndim,
26306  * object (*to_object_func)(char *),
26307  */
26308  __Pyx_TraceLine(1001,0,__PYX_ERR(1, 1001, __pyx_L1_error))
26309 
26310 
26311  /* "View.MemoryView":1054
26312  *
26313  * @cname('__pyx_memoryview_get_slice_from_memoryview')
26314  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
26315  * __Pyx_memviewslice *mslice) except NULL:
26316  * cdef _memoryviewslice obj
26317  */
26318  __Pyx_TraceLine(1054,0,__PYX_ERR(1, 1054, __pyx_L1_error))
26319 
26320 
26321  /* "View.MemoryView":1065
26322  *
26323  * @cname('__pyx_memoryview_slice_copy')
26324  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
26325  * cdef int dim
26326  * cdef (Py_ssize_t*) shape, strides, suboffsets
26327  */
26328  __Pyx_TraceLine(1065,0,__PYX_ERR(1, 1065, __pyx_L1_error))
26329 
26330 
26331  /* "View.MemoryView":1082
26332  *
26333  * @cname('__pyx_memoryview_copy_object')
26334  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
26335  * "Create a new memoryview object"
26336  * cdef __Pyx_memviewslice memviewslice
26337  */
26338  __Pyx_TraceLine(1082,0,__PYX_ERR(1, 1082, __pyx_L1_error))
26339 
26340 
26341  /* "View.MemoryView":1089
26342  *
26343  * @cname('__pyx_memoryview_copy_object_from_slice')
26344  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
26345  * """
26346  * Create a new memoryview object from a given memoryview object and slice.
26347  */
26348  __Pyx_TraceLine(1089,0,__PYX_ERR(1, 1089, __pyx_L1_error))
26349 
26350 
26351  /* "View.MemoryView":1111
26352  *
26353  *
26354  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
26355  * if arg < 0:
26356  * return -arg
26357  */
26358  __Pyx_TraceLine(1111,0,__PYX_ERR(1, 1111, __pyx_L1_error))
26359 
26360 
26361  /* "View.MemoryView":1118
26362  *
26363  * @cname('__pyx_get_best_slice_order')
26364  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
26365  * """
26366  * Figure out the best memory access order for a given slice.
26367  */
26368  __Pyx_TraceLine(1118,0,__PYX_ERR(1, 1118, __pyx_L1_error))
26369 
26370 
26371  /* "View.MemoryView":1172
26372  * dst_data += dst_stride
26373  *
26374  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
26375  * __Pyx_memviewslice *dst,
26376  * int ndim, size_t itemsize) nogil:
26377  */
26378  __Pyx_TraceLine(1172,0,__PYX_ERR(1, 1172, __pyx_L1_error))
26379 
26380 
26381  /* "View.MemoryView":1179
26382  *
26383  * @cname('__pyx_memoryview_slice_get_size')
26384  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
26385  * "Return the size of the memory occupied by the slice in number of bytes"
26386  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
26387  */
26388  __Pyx_TraceLine(1179,0,__PYX_ERR(1, 1179, __pyx_L1_error))
26389 
26390 
26391  /* "View.MemoryView":1189
26392  *
26393  * @cname('__pyx_fill_contig_strides_array')
26394  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
26395  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
26396  * int ndim, char order) nogil:
26397  */
26398  __Pyx_TraceLine(1189,0,__PYX_ERR(1, 1189, __pyx_L1_error))
26399 
26400 
26401  /* "View.MemoryView":1210
26402  *
26403  * @cname('__pyx_memoryview_copy_data_to_temp')
26404  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
26405  * __Pyx_memviewslice *tmpslice,
26406  * char order,
26407  */
26408  __Pyx_TraceLine(1210,0,__PYX_ERR(1, 1210, __pyx_L1_error))
26409 
26410 
26411  /* "View.MemoryView":1253
26412  *
26413  * @cname('__pyx_memoryview_err_extents')
26414  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
26415  * Py_ssize_t extent2) except -1 with gil:
26416  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
26417  */
26418  __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
26419 
26420 
26421  /* "View.MemoryView":1259
26422  *
26423  * @cname('__pyx_memoryview_err_dim')
26424  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
26425  * raise error(msg.decode('ascii') % dim)
26426  *
26427  */
26428  __Pyx_TraceLine(1259,0,__PYX_ERR(1, 1259, __pyx_L1_error))
26429 
26430 
26431  /* "View.MemoryView":1263
26432  *
26433  * @cname('__pyx_memoryview_err')
26434  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
26435  * if msg != NULL:
26436  * raise error(msg.decode('ascii'))
26437  */
26438  __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
26439 
26440 
26441  /* "View.MemoryView":1270
26442  *
26443  * @cname('__pyx_memoryview_copy_contents')
26444  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
26445  * __Pyx_memviewslice dst,
26446  * int src_ndim, int dst_ndim,
26447  */
26448  __Pyx_TraceLine(1270,0,__PYX_ERR(1, 1270, __pyx_L1_error))
26449 
26450 
26451  /* "View.MemoryView":1342
26452  *
26453  * @cname('__pyx_memoryview_broadcast_leading')
26454  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
26455  * int ndim,
26456  * int ndim_other) nogil:
26457  */
26458  __Pyx_TraceLine(1342,0,__PYX_ERR(1, 1342, __pyx_L1_error))
26459 
26460 
26461  /* "View.MemoryView":1364
26462  *
26463  * @cname('__pyx_memoryview_refcount_copying')
26464  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
26465  * int ndim, bint inc) nogil:
26466  *
26467  */
26468  __Pyx_TraceLine(1364,0,__PYX_ERR(1, 1364, __pyx_L1_error))
26469 
26470 
26471  /* "View.MemoryView":1373
26472  *
26473  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
26474  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
26475  * Py_ssize_t *strides, int ndim,
26476  * bint inc) with gil:
26477  */
26478  __Pyx_TraceLine(1373,0,__PYX_ERR(1, 1373, __pyx_L1_error))
26479 
26480 
26481  /* "View.MemoryView":1379
26482  *
26483  * @cname('__pyx_memoryview_refcount_objects_in_slice')
26484  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
26485  * Py_ssize_t *strides, int ndim, bint inc):
26486  * cdef Py_ssize_t i
26487  */
26488  __Pyx_TraceLine(1379,0,__PYX_ERR(1, 1379, __pyx_L1_error))
26489 
26490 
26491  /* "View.MemoryView":1399
26492  *
26493  * @cname('__pyx_memoryview_slice_assign_scalar')
26494  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
26495  * size_t itemsize, void *item,
26496  * bint dtype_is_object) nogil:
26497  */
26498  __Pyx_TraceLine(1399,0,__PYX_ERR(1, 1399, __pyx_L1_error))
26499 
26500 
26501  /* "View.MemoryView":1409
26502  *
26503  * @cname('__pyx_memoryview__slice_assign_scalar')
26504  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
26505  * Py_ssize_t *strides, int ndim,
26506  * size_t itemsize, void *item) nogil:
26507  */
26508  __Pyx_TraceLine(1409,0,__PYX_ERR(1, 1409, __pyx_L1_error))
26509 
26510 
26511  /* "(tree fragment)":1
26512  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
26513  * cdef object __pyx_PickleError
26514  * cdef object __pyx_result
26515  */
26516  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
26517  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
26518  __Pyx_GOTREF(__pyx_t_2);
26519  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
26520  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26521 
26522  /* "(tree fragment)":11
26523  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
26524  * return __pyx_result
26525  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
26526  * __pyx_result.name = __pyx_state[0]
26527  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
26528  */
26529  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
26530 
26531  __Pyx_TraceReturn(Py_None, 0);
26532 
26533  /*--- Wrapped vars code ---*/
26534 
26535  goto __pyx_L0;
26536  __pyx_L1_error:;
26537  __Pyx_XDECREF(__pyx_t_1);
26538  __Pyx_XDECREF(__pyx_t_2);
26539  if (__pyx_m) {
26540  if (__pyx_d) {
26541  __Pyx_AddTraceback("init imate.traceinv._hutchinson_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
26542  }
26543  Py_CLEAR(__pyx_m);
26544  } else if (!PyErr_Occurred()) {
26545  PyErr_SetString(PyExc_ImportError, "init imate.traceinv._hutchinson_method");
26546  }
26547  __pyx_L0:;
26548  __Pyx_RefNannyFinishContext();
26549  #if CYTHON_PEP489_MULTI_PHASE_INIT
26550  return (__pyx_m != NULL) ? 0 : -1;
26551  #elif PY_MAJOR_VERSION >= 3
26552  return __pyx_m;
26553  #else
26554  return;
26555  #endif
26556 }
26557 
26558 /* --- Runtime support code --- */
26559 /* Refnanny */
26560 #if CYTHON_REFNANNY
26561 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
26562  PyObject *m = NULL, *p = NULL;
26563  void *r = NULL;
26564  m = PyImport_ImportModule(modname);
26565  if (!m) goto end;
26566  p = PyObject_GetAttrString(m, "RefNannyAPI");
26567  if (!p) goto end;
26568  r = PyLong_AsVoidPtr(p);
26569 end:
26570  Py_XDECREF(p);
26571  Py_XDECREF(m);
26572  return (__Pyx_RefNannyAPIStruct *)r;
26573 }
26574 #endif
26575 
26576 /* PyObjectGetAttrStr */
26577 #if CYTHON_USE_TYPE_SLOTS
26578 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
26579  PyTypeObject* tp = Py_TYPE(obj);
26580  if (likely(tp->tp_getattro))
26581  return tp->tp_getattro(obj, attr_name);
26582 #if PY_MAJOR_VERSION < 3
26583  if (likely(tp->tp_getattr))
26584  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
26585 #endif
26586  return PyObject_GetAttr(obj, attr_name);
26587 }
26588 #endif
26589 
26590 /* GetBuiltinName */
26591 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
26592  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
26593  if (unlikely(!result)) {
26594  PyErr_Format(PyExc_NameError,
26595 #if PY_MAJOR_VERSION >= 3
26596  "name '%U' is not defined", name);
26597 #else
26598  "name '%.200s' is not defined", PyString_AS_STRING(name));
26599 #endif
26600  }
26601  return result;
26602 }
26603 
26604 /* RaiseDoubleKeywords */
26605 static void __Pyx_RaiseDoubleKeywordsError(
26606  const char* func_name,
26607  PyObject* kw_name)
26608 {
26609  PyErr_Format(PyExc_TypeError,
26610  #if PY_MAJOR_VERSION >= 3
26611  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
26612  #else
26613  "%s() got multiple values for keyword argument '%s'", func_name,
26614  PyString_AsString(kw_name));
26615  #endif
26616 }
26617 
26618 /* ParseKeywords */
26619 static int __Pyx_ParseOptionalKeywords(
26620  PyObject *kwds,
26621  PyObject **argnames[],
26622  PyObject *kwds2,
26623  PyObject *values[],
26624  Py_ssize_t num_pos_args,
26625  const char* function_name)
26626 {
26627  PyObject *key = 0, *value = 0;
26628  Py_ssize_t pos = 0;
26629  PyObject*** name;
26630  PyObject*** first_kw_arg = argnames + num_pos_args;
26631  while (PyDict_Next(kwds, &pos, &key, &value)) {
26632  name = first_kw_arg;
26633  while (*name && (**name != key)) name++;
26634  if (*name) {
26635  values[name-argnames] = value;
26636  continue;
26637  }
26638  name = first_kw_arg;
26639  #if PY_MAJOR_VERSION < 3
26640  if (likely(PyString_Check(key))) {
26641  while (*name) {
26642  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
26643  && _PyString_Eq(**name, key)) {
26644  values[name-argnames] = value;
26645  break;
26646  }
26647  name++;
26648  }
26649  if (*name) continue;
26650  else {
26651  PyObject*** argname = argnames;
26652  while (argname != first_kw_arg) {
26653  if ((**argname == key) || (
26654  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
26655  && _PyString_Eq(**argname, key))) {
26656  goto arg_passed_twice;
26657  }
26658  argname++;
26659  }
26660  }
26661  } else
26662  #endif
26663  if (likely(PyUnicode_Check(key))) {
26664  while (*name) {
26665  int cmp = (**name == key) ? 0 :
26666  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26667  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26668  #endif
26669  PyUnicode_Compare(**name, key);
26670  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26671  if (cmp == 0) {
26672  values[name-argnames] = value;
26673  break;
26674  }
26675  name++;
26676  }
26677  if (*name) continue;
26678  else {
26679  PyObject*** argname = argnames;
26680  while (argname != first_kw_arg) {
26681  int cmp = (**argname == key) ? 0 :
26682  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26683  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26684  #endif
26685  PyUnicode_Compare(**argname, key);
26686  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26687  if (cmp == 0) goto arg_passed_twice;
26688  argname++;
26689  }
26690  }
26691  } else
26692  goto invalid_keyword_type;
26693  if (kwds2) {
26694  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
26695  } else {
26696  goto invalid_keyword;
26697  }
26698  }
26699  return 0;
26700 arg_passed_twice:
26701  __Pyx_RaiseDoubleKeywordsError(function_name, key);
26702  goto bad;
26703 invalid_keyword_type:
26704  PyErr_Format(PyExc_TypeError,
26705  "%.200s() keywords must be strings", function_name);
26706  goto bad;
26707 invalid_keyword:
26708  PyErr_Format(PyExc_TypeError,
26709  #if PY_MAJOR_VERSION < 3
26710  "%.200s() got an unexpected keyword argument '%.200s'",
26711  function_name, PyString_AsString(key));
26712  #else
26713  "%s() got an unexpected keyword argument '%U'",
26714  function_name, key);
26715  #endif
26716 bad:
26717  return -1;
26718 }
26719 
26720 /* RaiseArgTupleInvalid */
26721 static void __Pyx_RaiseArgtupleInvalid(
26722  const char* func_name,
26723  int exact,
26724  Py_ssize_t num_min,
26725  Py_ssize_t num_max,
26726  Py_ssize_t num_found)
26727 {
26728  Py_ssize_t num_expected;
26729  const char *more_or_less;
26730  if (num_found < num_min) {
26731  num_expected = num_min;
26732  more_or_less = "at least";
26733  } else {
26734  num_expected = num_max;
26735  more_or_less = "at most";
26736  }
26737  if (exact) {
26738  more_or_less = "exactly";
26739  }
26740  PyErr_Format(PyExc_TypeError,
26741  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
26742  func_name, more_or_less, num_expected,
26743  (num_expected == 1) ? "" : "s", num_found);
26744 }
26745 
26746 /* PyErrFetchRestore */
26747 #if CYTHON_FAST_THREAD_STATE
26748 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26749  PyObject *tmp_type, *tmp_value, *tmp_tb;
26750  tmp_type = tstate->curexc_type;
26751  tmp_value = tstate->curexc_value;
26752  tmp_tb = tstate->curexc_traceback;
26753  tstate->curexc_type = type;
26754  tstate->curexc_value = value;
26755  tstate->curexc_traceback = tb;
26756  Py_XDECREF(tmp_type);
26757  Py_XDECREF(tmp_value);
26758  Py_XDECREF(tmp_tb);
26759 }
26760 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26761  *type = tstate->curexc_type;
26762  *value = tstate->curexc_value;
26763  *tb = tstate->curexc_traceback;
26764  tstate->curexc_type = 0;
26765  tstate->curexc_value = 0;
26766  tstate->curexc_traceback = 0;
26767 }
26768 #endif
26769 
26770 /* Profile */
26771 #if CYTHON_PROFILE
26772 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
26773  PyFrameObject** frame,
26774  PyThreadState* tstate,
26775  const char *funcname,
26776  const char *srcfile,
26777  int firstlineno) {
26778  PyObject *type, *value, *traceback;
26779  int retval;
26780  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
26781  if (*code == NULL) {
26782  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
26783  if (*code == NULL) return 0;
26784  }
26785  *frame = PyFrame_New(
26786  tstate, /*PyThreadState *tstate*/
26787  *code, /*PyCodeObject *code*/
26788  __pyx_d, /*PyObject *globals*/
26789  0 /*PyObject *locals*/
26790  );
26791  if (*frame == NULL) return 0;
26792  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
26793  Py_INCREF(Py_None);
26794  (*frame)->f_trace = Py_None;
26795  }
26796 #if PY_VERSION_HEX < 0x030400B1
26797  } else {
26798  (*frame)->f_tstate = tstate;
26799 #endif
26800  }
26801  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
26802  retval = 1;
26803  __Pyx_EnterTracing(tstate);
26804  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
26805  #if CYTHON_TRACE
26806  if (tstate->c_tracefunc)
26807  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
26808  if (retval && tstate->c_profilefunc)
26809  #endif
26810  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
26811  __Pyx_LeaveTracing(tstate);
26812  if (retval) {
26813  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
26814  return __Pyx_IsTracing(tstate, 0, 0) && retval;
26815  } else {
26816  Py_XDECREF(type);
26817  Py_XDECREF(value);
26818  Py_XDECREF(traceback);
26819  return -1;
26820  }
26821 }
26822 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
26823  PyCodeObject *py_code = 0;
26824 #if PY_MAJOR_VERSION >= 3
26825  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
26826  if (likely(py_code)) {
26827  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
26828  }
26829 #else
26830  PyObject *py_srcfile = 0;
26831  PyObject *py_funcname = 0;
26832  py_funcname = PyString_FromString(funcname);
26833  if (unlikely(!py_funcname)) goto bad;
26834  py_srcfile = PyString_FromString(srcfile);
26835  if (unlikely(!py_srcfile)) goto bad;
26836  py_code = PyCode_New(
26837  0,
26838  0,
26839  0,
26840  CO_OPTIMIZED | CO_NEWLOCALS,
26841  __pyx_empty_bytes, /*PyObject *code,*/
26842  __pyx_empty_tuple, /*PyObject *consts,*/
26843  __pyx_empty_tuple, /*PyObject *names,*/
26844  __pyx_empty_tuple, /*PyObject *varnames,*/
26845  __pyx_empty_tuple, /*PyObject *freevars,*/
26846  __pyx_empty_tuple, /*PyObject *cellvars,*/
26847  py_srcfile, /*PyObject *filename,*/
26848  py_funcname, /*PyObject *name,*/
26849  firstlineno,
26850  __pyx_empty_bytes /*PyObject *lnotab*/
26851  );
26852 bad:
26853  Py_XDECREF(py_srcfile);
26854  Py_XDECREF(py_funcname);
26855 #endif
26856  return py_code;
26857 }
26858 #endif
26859 
26860 /* PyDictVersioning */
26861 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
26862 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
26863  PyObject *dict = Py_TYPE(obj)->tp_dict;
26864  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
26865 }
26866 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
26867  PyObject **dictptr = NULL;
26868  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
26869  if (offset) {
26870 #if CYTHON_COMPILING_IN_CPYTHON
26871  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
26872 #else
26873  dictptr = _PyObject_GetDictPtr(obj);
26874 #endif
26875  }
26876  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
26877 }
26878 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
26879  PyObject *dict = Py_TYPE(obj)->tp_dict;
26880  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
26881  return 0;
26882  return obj_dict_version == __Pyx_get_object_dict_version(obj);
26883 }
26884 #endif
26885 
26886 /* GetModuleGlobalName */
26887 #if CYTHON_USE_DICT_VERSIONS
26888 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
26889 #else
26890 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
26891 #endif
26892 {
26893  PyObject *result;
26894 #if !CYTHON_AVOID_BORROWED_REFS
26895 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
26896  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
26897  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26898  if (likely(result)) {
26899  return __Pyx_NewRef(result);
26900  } else if (unlikely(PyErr_Occurred())) {
26901  return NULL;
26902  }
26903 #else
26904  result = PyDict_GetItem(__pyx_d, name);
26905  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26906  if (likely(result)) {
26907  return __Pyx_NewRef(result);
26908  }
26909 #endif
26910 #else
26911  result = PyObject_GetItem(__pyx_d, name);
26912  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
26913  if (likely(result)) {
26914  return __Pyx_NewRef(result);
26915  }
26916  PyErr_Clear();
26917 #endif
26918  return __Pyx_GetBuiltinName(name);
26919 }
26920 
26921 /* PyFunctionFastCall */
26922 #if CYTHON_FAST_PYCALL
26923 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
26924  PyObject *globals) {
26925  PyFrameObject *f;
26926  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26927  PyObject **fastlocals;
26928  Py_ssize_t i;
26929  PyObject *result;
26930  assert(globals != NULL);
26931  /* XXX Perhaps we should create a specialized
26932  PyFrame_New() that doesn't take locals, but does
26933  take builtins without sanity checking them.
26934  */
26935  assert(tstate != NULL);
26936  f = PyFrame_New(tstate, co, globals, NULL);
26937  if (f == NULL) {
26938  return NULL;
26939  }
26940  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
26941  for (i = 0; i < na; i++) {
26942  Py_INCREF(*args);
26943  fastlocals[i] = *args++;
26944  }
26945  result = PyEval_EvalFrameEx(f,0);
26946  ++tstate->recursion_depth;
26947  Py_DECREF(f);
26948  --tstate->recursion_depth;
26949  return result;
26950 }
26951 #if 1 || PY_VERSION_HEX < 0x030600B1
26952 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
26953  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
26954  PyObject *globals = PyFunction_GET_GLOBALS(func);
26955  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
26956  PyObject *closure;
26957 #if PY_MAJOR_VERSION >= 3
26958  PyObject *kwdefs;
26959 #endif
26960  PyObject *kwtuple, **k;
26961  PyObject **d;
26962  Py_ssize_t nd;
26963  Py_ssize_t nk;
26964  PyObject *result;
26965  assert(kwargs == NULL || PyDict_Check(kwargs));
26966  nk = kwargs ? PyDict_Size(kwargs) : 0;
26967  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
26968  return NULL;
26969  }
26970  if (
26971 #if PY_MAJOR_VERSION >= 3
26972  co->co_kwonlyargcount == 0 &&
26973 #endif
26974  likely(kwargs == NULL || nk == 0) &&
26975  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
26976  if (argdefs == NULL && co->co_argcount == nargs) {
26977  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
26978  goto done;
26979  }
26980  else if (nargs == 0 && argdefs != NULL
26981  && co->co_argcount == Py_SIZE(argdefs)) {
26982  /* function called with no arguments, but all parameters have
26983  a default value: use default values as arguments .*/
26984  args = &PyTuple_GET_ITEM(argdefs, 0);
26985  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
26986  goto done;
26987  }
26988  }
26989  if (kwargs != NULL) {
26990  Py_ssize_t pos, i;
26991  kwtuple = PyTuple_New(2 * nk);
26992  if (kwtuple == NULL) {
26993  result = NULL;
26994  goto done;
26995  }
26996  k = &PyTuple_GET_ITEM(kwtuple, 0);
26997  pos = i = 0;
26998  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
26999  Py_INCREF(k[i]);
27000  Py_INCREF(k[i+1]);
27001  i += 2;
27002  }
27003  nk = i / 2;
27004  }
27005  else {
27006  kwtuple = NULL;
27007  k = NULL;
27008  }
27009  closure = PyFunction_GET_CLOSURE(func);
27010 #if PY_MAJOR_VERSION >= 3
27011  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
27012 #endif
27013  if (argdefs != NULL) {
27014  d = &PyTuple_GET_ITEM(argdefs, 0);
27015  nd = Py_SIZE(argdefs);
27016  }
27017  else {
27018  d = NULL;
27019  nd = 0;
27020  }
27021 #if PY_MAJOR_VERSION >= 3
27022  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
27023  args, (int)nargs,
27024  k, (int)nk,
27025  d, (int)nd, kwdefs, closure);
27026 #else
27027  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
27028  args, (int)nargs,
27029  k, (int)nk,
27030  d, (int)nd, closure);
27031 #endif
27032  Py_XDECREF(kwtuple);
27033 done:
27034  Py_LeaveRecursiveCall();
27035  return result;
27036 }
27037 #endif
27038 #endif
27039 
27040 /* PyCFunctionFastCall */
27041 #if CYTHON_FAST_PYCCALL
27042 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
27043  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
27044  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
27045  PyObject *self = PyCFunction_GET_SELF(func);
27046  int flags = PyCFunction_GET_FLAGS(func);
27047  assert(PyCFunction_Check(func));
27048  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
27049  assert(nargs >= 0);
27050  assert(nargs == 0 || args != NULL);
27051  /* _PyCFunction_FastCallDict() must not be called with an exception set,
27052  because it may clear it (directly or indirectly) and so the
27053  caller loses its exception */
27054  assert(!PyErr_Occurred());
27055  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
27056  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
27057  } else {
27058  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
27059  }
27060 }
27061 #endif
27062 
27063 /* PyObjectCall */
27064 #if CYTHON_COMPILING_IN_CPYTHON
27065 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
27066  PyObject *result;
27067  ternaryfunc call = Py_TYPE(func)->tp_call;
27068  if (unlikely(!call))
27069  return PyObject_Call(func, arg, kw);
27070  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
27071  return NULL;
27072  result = (*call)(func, arg, kw);
27073  Py_LeaveRecursiveCall();
27074  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
27075  PyErr_SetString(
27076  PyExc_SystemError,
27077  "NULL result without error in PyObject_Call");
27078  }
27079  return result;
27080 }
27081 #endif
27082 
27083 /* RaiseTooManyValuesToUnpack */
27084 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
27085  PyErr_Format(PyExc_ValueError,
27086  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
27087 }
27088 
27089 /* RaiseNeedMoreValuesToUnpack */
27090 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
27091  PyErr_Format(PyExc_ValueError,
27092  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
27093  index, (index == 1) ? "" : "s");
27094 }
27095 
27096 /* IterFinish */
27097 static CYTHON_INLINE int __Pyx_IterFinish(void) {
27098 #if CYTHON_FAST_THREAD_STATE
27099  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27100  PyObject* exc_type = tstate->curexc_type;
27101  if (unlikely(exc_type)) {
27102  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
27103  PyObject *exc_value, *exc_tb;
27104  exc_value = tstate->curexc_value;
27105  exc_tb = tstate->curexc_traceback;
27106  tstate->curexc_type = 0;
27107  tstate->curexc_value = 0;
27108  tstate->curexc_traceback = 0;
27109  Py_DECREF(exc_type);
27110  Py_XDECREF(exc_value);
27111  Py_XDECREF(exc_tb);
27112  return 0;
27113  } else {
27114  return -1;
27115  }
27116  }
27117  return 0;
27118 #else
27119  if (unlikely(PyErr_Occurred())) {
27120  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
27121  PyErr_Clear();
27122  return 0;
27123  } else {
27124  return -1;
27125  }
27126  }
27127  return 0;
27128 #endif
27129 }
27130 
27131 /* UnpackItemEndCheck */
27132 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
27133  if (unlikely(retval)) {
27134  Py_DECREF(retval);
27135  __Pyx_RaiseTooManyValuesError(expected);
27136  return -1;
27137  }
27138  return __Pyx_IterFinish();
27139 }
27140 
27141 /* GetItemInt */
27142 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
27143  PyObject *r;
27144  if (!j) return NULL;
27145  r = PyObject_GetItem(o, j);
27146  Py_DECREF(j);
27147  return r;
27148 }
27149 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
27150  CYTHON_NCP_UNUSED int wraparound,
27151  CYTHON_NCP_UNUSED int boundscheck) {
27152 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27153  Py_ssize_t wrapped_i = i;
27154  if (wraparound & unlikely(i < 0)) {
27155  wrapped_i += PyList_GET_SIZE(o);
27156  }
27157  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
27158  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
27159  Py_INCREF(r);
27160  return r;
27161  }
27162  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27163 #else
27164  return PySequence_GetItem(o, i);
27165 #endif
27166 }
27167 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
27168  CYTHON_NCP_UNUSED int wraparound,
27169  CYTHON_NCP_UNUSED int boundscheck) {
27170 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27171  Py_ssize_t wrapped_i = i;
27172  if (wraparound & unlikely(i < 0)) {
27173  wrapped_i += PyTuple_GET_SIZE(o);
27174  }
27175  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
27176  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
27177  Py_INCREF(r);
27178  return r;
27179  }
27180  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27181 #else
27182  return PySequence_GetItem(o, i);
27183 #endif
27184 }
27185 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
27186  CYTHON_NCP_UNUSED int wraparound,
27187  CYTHON_NCP_UNUSED int boundscheck) {
27188 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
27189  if (is_list || PyList_CheckExact(o)) {
27190  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
27191  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
27192  PyObject *r = PyList_GET_ITEM(o, n);
27193  Py_INCREF(r);
27194  return r;
27195  }
27196  }
27197  else if (PyTuple_CheckExact(o)) {
27198  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
27199  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
27200  PyObject *r = PyTuple_GET_ITEM(o, n);
27201  Py_INCREF(r);
27202  return r;
27203  }
27204  } else {
27205  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
27206  if (likely(m && m->sq_item)) {
27207  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
27208  Py_ssize_t l = m->sq_length(o);
27209  if (likely(l >= 0)) {
27210  i += l;
27211  } else {
27212  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27213  return NULL;
27214  PyErr_Clear();
27215  }
27216  }
27217  return m->sq_item(o, i);
27218  }
27219  }
27220 #else
27221  if (is_list || PySequence_Check(o)) {
27222  return PySequence_GetItem(o, i);
27223  }
27224 #endif
27225  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27226 }
27227 
27228 /* PyObjectCallMethO */
27229 #if CYTHON_COMPILING_IN_CPYTHON
27230 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
27231  PyObject *self, *result;
27232  PyCFunction cfunc;
27233  cfunc = PyCFunction_GET_FUNCTION(func);
27234  self = PyCFunction_GET_SELF(func);
27235  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
27236  return NULL;
27237  result = cfunc(self, arg);
27238  Py_LeaveRecursiveCall();
27239  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
27240  PyErr_SetString(
27241  PyExc_SystemError,
27242  "NULL result without error in PyObject_Call");
27243  }
27244  return result;
27245 }
27246 #endif
27247 
27248 /* PyObjectCallNoArg */
27249 #if CYTHON_COMPILING_IN_CPYTHON
27250 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
27251 #if CYTHON_FAST_PYCALL
27252  if (PyFunction_Check(func)) {
27253  return __Pyx_PyFunction_FastCall(func, NULL, 0);
27254  }
27255 #endif
27256 #if defined(__Pyx_CyFunction_USED) && defined(NDEBUG)
27257  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
27258 #else
27259  if (likely(PyCFunction_Check(func)))
27260 #endif
27261  {
27262  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
27263  return __Pyx_PyObject_CallMethO(func, NULL);
27264  }
27265  }
27266  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
27267 }
27268 #endif
27269 
27270 /* PyObjectCallOneArg */
27271 #if CYTHON_COMPILING_IN_CPYTHON
27272 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27273  PyObject *result;
27274  PyObject *args = PyTuple_New(1);
27275  if (unlikely(!args)) return NULL;
27276  Py_INCREF(arg);
27277  PyTuple_SET_ITEM(args, 0, arg);
27278  result = __Pyx_PyObject_Call(func, args, NULL);
27279  Py_DECREF(args);
27280  return result;
27281 }
27282 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27283 #if CYTHON_FAST_PYCALL
27284  if (PyFunction_Check(func)) {
27285  return __Pyx_PyFunction_FastCall(func, &arg, 1);
27286  }
27287 #endif
27288  if (likely(PyCFunction_Check(func))) {
27289  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
27290  return __Pyx_PyObject_CallMethO(func, arg);
27291 #if CYTHON_FAST_PYCCALL
27292  } else if (__Pyx_PyFastCFunction_Check(func)) {
27293  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
27294 #endif
27295  }
27296  }
27297  return __Pyx__PyObject_CallOneArg(func, arg);
27298 }
27299 #else
27300 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27301  PyObject *result;
27302  PyObject *args = PyTuple_Pack(1, arg);
27303  if (unlikely(!args)) return NULL;
27304  result = __Pyx_PyObject_Call(func, args, NULL);
27305  Py_DECREF(args);
27306  return result;
27307 }
27308 #endif
27309 
27310 /* PyObjectCall2Args */
27311 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
27312  PyObject *args, *result = NULL;
27313  #if CYTHON_FAST_PYCALL
27314  if (PyFunction_Check(function)) {
27315  PyObject *args[2] = {arg1, arg2};
27316  return __Pyx_PyFunction_FastCall(function, args, 2);
27317  }
27318  #endif
27319  #if CYTHON_FAST_PYCCALL
27320  if (__Pyx_PyFastCFunction_Check(function)) {
27321  PyObject *args[2] = {arg1, arg2};
27322  return __Pyx_PyCFunction_FastCall(function, args, 2);
27323  }
27324  #endif
27325  args = PyTuple_New(2);
27326  if (unlikely(!args)) goto done;
27327  Py_INCREF(arg1);
27328  PyTuple_SET_ITEM(args, 0, arg1);
27329  Py_INCREF(arg2);
27330  PyTuple_SET_ITEM(args, 1, arg2);
27331  Py_INCREF(function);
27332  result = __Pyx_PyObject_Call(function, args, NULL);
27333  Py_DECREF(args);
27334  Py_DECREF(function);
27335 done:
27336  return result;
27337 }
27338 
27339 /* BytesEquals */
27340 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
27341 #if CYTHON_COMPILING_IN_PYPY
27342  return PyObject_RichCompareBool(s1, s2, equals);
27343 #else
27344  if (s1 == s2) {
27345  return (equals == Py_EQ);
27346  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
27347  const char *ps1, *ps2;
27348  Py_ssize_t length = PyBytes_GET_SIZE(s1);
27349  if (length != PyBytes_GET_SIZE(s2))
27350  return (equals == Py_NE);
27351  ps1 = PyBytes_AS_STRING(s1);
27352  ps2 = PyBytes_AS_STRING(s2);
27353  if (ps1[0] != ps2[0]) {
27354  return (equals == Py_NE);
27355  } else if (length == 1) {
27356  return (equals == Py_EQ);
27357  } else {
27358  int result;
27359 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
27360  Py_hash_t hash1, hash2;
27361  hash1 = ((PyBytesObject*)s1)->ob_shash;
27362  hash2 = ((PyBytesObject*)s2)->ob_shash;
27363  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
27364  return (equals == Py_NE);
27365  }
27366 #endif
27367  result = memcmp(ps1, ps2, (size_t)length);
27368  return (equals == Py_EQ) ? (result == 0) : (result != 0);
27369  }
27370  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
27371  return (equals == Py_NE);
27372  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
27373  return (equals == Py_NE);
27374  } else {
27375  int result;
27376  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
27377  if (!py_result)
27378  return -1;
27379  result = __Pyx_PyObject_IsTrue(py_result);
27380  Py_DECREF(py_result);
27381  return result;
27382  }
27383 #endif
27384 }
27385 
27386 /* RaiseException */
27387 #if PY_MAJOR_VERSION < 3
27388 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
27389  CYTHON_UNUSED PyObject *cause) {
27390  __Pyx_PyThreadState_declare
27391  Py_XINCREF(type);
27392  if (!value || value == Py_None)
27393  value = NULL;
27394  else
27395  Py_INCREF(value);
27396  if (!tb || tb == Py_None)
27397  tb = NULL;
27398  else {
27399  Py_INCREF(tb);
27400  if (!PyTraceBack_Check(tb)) {
27401  PyErr_SetString(PyExc_TypeError,
27402  "raise: arg 3 must be a traceback or None");
27403  goto raise_error;
27404  }
27405  }
27406  if (PyType_Check(type)) {
27407 #if CYTHON_COMPILING_IN_PYPY
27408  if (!value) {
27409  Py_INCREF(Py_None);
27410  value = Py_None;
27411  }
27412 #endif
27413  PyErr_NormalizeException(&type, &value, &tb);
27414  } else {
27415  if (value) {
27416  PyErr_SetString(PyExc_TypeError,
27417  "instance exception may not have a separate value");
27418  goto raise_error;
27419  }
27420  value = type;
27421  type = (PyObject*) Py_TYPE(type);
27422  Py_INCREF(type);
27423  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
27424  PyErr_SetString(PyExc_TypeError,
27425  "raise: exception class must be a subclass of BaseException");
27426  goto raise_error;
27427  }
27428  }
27429  __Pyx_PyThreadState_assign
27430  __Pyx_ErrRestore(type, value, tb);
27431  return;
27432 raise_error:
27433  Py_XDECREF(value);
27434  Py_XDECREF(type);
27435  Py_XDECREF(tb);
27436  return;
27437 }
27438 #else
27439 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
27440  PyObject* owned_instance = NULL;
27441  if (tb == Py_None) {
27442  tb = 0;
27443  } else if (tb && !PyTraceBack_Check(tb)) {
27444  PyErr_SetString(PyExc_TypeError,
27445  "raise: arg 3 must be a traceback or None");
27446  goto bad;
27447  }
27448  if (value == Py_None)
27449  value = 0;
27450  if (PyExceptionInstance_Check(type)) {
27451  if (value) {
27452  PyErr_SetString(PyExc_TypeError,
27453  "instance exception may not have a separate value");
27454  goto bad;
27455  }
27456  value = type;
27457  type = (PyObject*) Py_TYPE(value);
27458  } else if (PyExceptionClass_Check(type)) {
27459  PyObject *instance_class = NULL;
27460  if (value && PyExceptionInstance_Check(value)) {
27461  instance_class = (PyObject*) Py_TYPE(value);
27462  if (instance_class != type) {
27463  int is_subclass = PyObject_IsSubclass(instance_class, type);
27464  if (!is_subclass) {
27465  instance_class = NULL;
27466  } else if (unlikely(is_subclass == -1)) {
27467  goto bad;
27468  } else {
27469  type = instance_class;
27470  }
27471  }
27472  }
27473  if (!instance_class) {
27474  PyObject *args;
27475  if (!value)
27476  args = PyTuple_New(0);
27477  else if (PyTuple_Check(value)) {
27478  Py_INCREF(value);
27479  args = value;
27480  } else
27481  args = PyTuple_Pack(1, value);
27482  if (!args)
27483  goto bad;
27484  owned_instance = PyObject_Call(type, args, NULL);
27485  Py_DECREF(args);
27486  if (!owned_instance)
27487  goto bad;
27488  value = owned_instance;
27489  if (!PyExceptionInstance_Check(value)) {
27490  PyErr_Format(PyExc_TypeError,
27491  "calling %R should have returned an instance of "
27492  "BaseException, not %R",
27493  type, Py_TYPE(value));
27494  goto bad;
27495  }
27496  }
27497  } else {
27498  PyErr_SetString(PyExc_TypeError,
27499  "raise: exception class must be a subclass of BaseException");
27500  goto bad;
27501  }
27502  if (cause) {
27503  PyObject *fixed_cause;
27504  if (cause == Py_None) {
27505  fixed_cause = NULL;
27506  } else if (PyExceptionClass_Check(cause)) {
27507  fixed_cause = PyObject_CallObject(cause, NULL);
27508  if (fixed_cause == NULL)
27509  goto bad;
27510  } else if (PyExceptionInstance_Check(cause)) {
27511  fixed_cause = cause;
27512  Py_INCREF(fixed_cause);
27513  } else {
27514  PyErr_SetString(PyExc_TypeError,
27515  "exception causes must derive from "
27516  "BaseException");
27517  goto bad;
27518  }
27519  PyException_SetCause(value, fixed_cause);
27520  }
27521  PyErr_SetObject(type, value);
27522  if (tb) {
27523 #if CYTHON_FAST_THREAD_STATE
27524  PyThreadState *tstate = __Pyx_PyThreadState_Current;
27525  PyObject* tmp_tb = tstate->curexc_traceback;
27526  if (tb != tmp_tb) {
27527  Py_INCREF(tb);
27528  tstate->curexc_traceback = tb;
27529  Py_XDECREF(tmp_tb);
27530  }
27531 #else
27532  PyObject *tmp_type, *tmp_value, *tmp_tb;
27533  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
27534  Py_INCREF(tb);
27535  PyErr_Restore(tmp_type, tmp_value, tb);
27536  Py_XDECREF(tmp_tb);
27537 #endif
27538  }
27539 bad:
27540  Py_XDECREF(owned_instance);
27541  return;
27542 }
27543 #endif
27544 
27545 /* SliceObject */
27546 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
27547  Py_ssize_t cstart, Py_ssize_t cstop,
27548  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
27549  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
27550 #if CYTHON_USE_TYPE_SLOTS
27551  PyMappingMethods* mp;
27552 #if PY_MAJOR_VERSION < 3
27553  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
27554  if (likely(ms && ms->sq_ass_slice)) {
27555  if (!has_cstart) {
27556  if (_py_start && (*_py_start != Py_None)) {
27557  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
27558  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
27559  } else
27560  cstart = 0;
27561  }
27562  if (!has_cstop) {
27563  if (_py_stop && (*_py_stop != Py_None)) {
27564  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
27565  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
27566  } else
27567  cstop = PY_SSIZE_T_MAX;
27568  }
27569  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
27570  Py_ssize_t l = ms->sq_length(obj);
27571  if (likely(l >= 0)) {
27572  if (cstop < 0) {
27573  cstop += l;
27574  if (cstop < 0) cstop = 0;
27575  }
27576  if (cstart < 0) {
27577  cstart += l;
27578  if (cstart < 0) cstart = 0;
27579  }
27580  } else {
27581  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27582  goto bad;
27583  PyErr_Clear();
27584  }
27585  }
27586  return ms->sq_ass_slice(obj, cstart, cstop, value);
27587  }
27588 #endif
27589  mp = Py_TYPE(obj)->tp_as_mapping;
27590  if (likely(mp && mp->mp_ass_subscript))
27591 #endif
27592  {
27593  int result;
27594  PyObject *py_slice, *py_start, *py_stop;
27595  if (_py_slice) {
27596  py_slice = *_py_slice;
27597  } else {
27598  PyObject* owned_start = NULL;
27599  PyObject* owned_stop = NULL;
27600  if (_py_start) {
27601  py_start = *_py_start;
27602  } else {
27603  if (has_cstart) {
27604  owned_start = py_start = PyInt_FromSsize_t(cstart);
27605  if (unlikely(!py_start)) goto bad;
27606  } else
27607  py_start = Py_None;
27608  }
27609  if (_py_stop) {
27610  py_stop = *_py_stop;
27611  } else {
27612  if (has_cstop) {
27613  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
27614  if (unlikely(!py_stop)) {
27615  Py_XDECREF(owned_start);
27616  goto bad;
27617  }
27618  } else
27619  py_stop = Py_None;
27620  }
27621  py_slice = PySlice_New(py_start, py_stop, Py_None);
27622  Py_XDECREF(owned_start);
27623  Py_XDECREF(owned_stop);
27624  if (unlikely(!py_slice)) goto bad;
27625  }
27626 #if CYTHON_USE_TYPE_SLOTS
27627  result = mp->mp_ass_subscript(obj, py_slice, value);
27628 #else
27629  result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
27630 #endif
27631  if (!_py_slice) {
27632  Py_DECREF(py_slice);
27633  }
27634  return result;
27635  }
27636  PyErr_Format(PyExc_TypeError,
27637  "'%.200s' object does not support slice %.10s",
27638  Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
27639 bad:
27640  return -1;
27641 }
27642 
27643 /* PyIntCompare */
27644 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
27645  if (op1 == op2) {
27646  Py_RETURN_TRUE;
27647  }
27648  #if PY_MAJOR_VERSION < 3
27649  if (likely(PyInt_CheckExact(op1))) {
27650  const long b = intval;
27651  long a = PyInt_AS_LONG(op1);
27652  if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
27653  }
27654  #endif
27655  #if CYTHON_USE_PYLONG_INTERNALS
27656  if (likely(PyLong_CheckExact(op1))) {
27657  int unequal;
27658  unsigned long uintval;
27659  Py_ssize_t size = Py_SIZE(op1);
27660  const digit* digits = ((PyLongObject*)op1)->ob_digit;
27661  if (intval == 0) {
27662  if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
27663  } else if (intval < 0) {
27664  if (size >= 0)
27665  Py_RETURN_FALSE;
27666  intval = -intval;
27667  size = -size;
27668  } else {
27669  if (size <= 0)
27670  Py_RETURN_FALSE;
27671  }
27672  uintval = (unsigned long) intval;
27673 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
27674  if (uintval >> (PyLong_SHIFT * 4)) {
27675  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
27676  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
27677  } else
27678 #endif
27679 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
27680  if (uintval >> (PyLong_SHIFT * 3)) {
27681  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
27682  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
27683  } else
27684 #endif
27685 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
27686  if (uintval >> (PyLong_SHIFT * 2)) {
27687  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
27688  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
27689  } else
27690 #endif
27691 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
27692  if (uintval >> (PyLong_SHIFT * 1)) {
27693  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
27694  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
27695  } else
27696 #endif
27697  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
27698  if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
27699  }
27700  #endif
27701  if (PyFloat_CheckExact(op1)) {
27702  const long b = intval;
27703  double a = PyFloat_AS_DOUBLE(op1);
27704  if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
27705  }
27706  return (
27707  PyObject_RichCompare(op1, op2, Py_EQ));
27708 }
27709 
27710 /* MatrixMultiply */
27711 #if PY_VERSION_HEX < 0x03050000
27712 static PyObject* __Pyx_PyObject_CallMatrixMethod(PyObject* method, PyObject* arg) {
27713  PyObject *result = NULL;
27714 #if CYTHON_UNPACK_METHODS
27715  if (likely(PyMethod_Check(method))) {
27716  PyObject *self = PyMethod_GET_SELF(method);
27717  if (likely(self)) {
27718  PyObject *args;
27719  PyObject *function = PyMethod_GET_FUNCTION(method);
27720  #if CYTHON_FAST_PYCALL
27721  if (PyFunction_Check(function)) {
27722  PyObject *args[2] = {self, arg};
27723  result = __Pyx_PyFunction_FastCall(function, args, 2);
27724  goto done;
27725  }
27726  #endif
27727  #if CYTHON_FAST_PYCCALL
27728  if (__Pyx_PyFastCFunction_Check(function)) {
27729  PyObject *args[2] = {self, arg};
27730  result = __Pyx_PyCFunction_FastCall(function, args, 2);
27731  goto done;
27732  }
27733  #endif
27734  args = PyTuple_New(2);
27735  if (unlikely(!args)) goto done;
27736  Py_INCREF(self);
27737  PyTuple_SET_ITEM(args, 0, self);
27738  Py_INCREF(arg);
27739  PyTuple_SET_ITEM(args, 1, arg);
27740  Py_INCREF(function);
27741  Py_DECREF(method); method = NULL;
27742  result = __Pyx_PyObject_Call(function, args, NULL);
27743  Py_DECREF(args);
27744  Py_DECREF(function);
27745  return result;
27746  }
27747  }
27748 #endif
27749  result = __Pyx_PyObject_CallOneArg(method, arg);
27750 done:
27751  Py_DECREF(method);
27752  return result;
27753 }
27754 #define __Pyx_TryMatrixMethod(x, y, py_method_name) {\
27755  PyObject *func = __Pyx_PyObject_GetAttrStr(x, py_method_name);\
27756  if (func) {\
27757  PyObject *result = __Pyx_PyObject_CallMatrixMethod(func, y);\
27758  if (result != Py_NotImplemented)\
27759  return result;\
27760  Py_DECREF(result);\
27761  } else {\
27762  if (!PyErr_ExceptionMatches(PyExc_AttributeError))\
27763  return NULL;\
27764  PyErr_Clear();\
27765  }\
27766 }
27767 static PyObject* __Pyx__PyNumber_MatrixMultiply(PyObject* x, PyObject* y, const char* op_name) {
27768  int right_is_subtype = PyObject_IsSubclass((PyObject*)Py_TYPE(y), (PyObject*)Py_TYPE(x));
27769  if (unlikely(right_is_subtype == -1))
27770  return NULL;
27771  if (right_is_subtype) {
27772  __Pyx_TryMatrixMethod(y, x, __pyx_n_s_rmatmul)
27773  }
27774  __Pyx_TryMatrixMethod(x, y, __pyx_n_s_matmul)
27775  if (!right_is_subtype) {
27776  __Pyx_TryMatrixMethod(y, x, __pyx_n_s_rmatmul)
27777  }
27778  PyErr_Format(PyExc_TypeError,
27779  "unsupported operand type(s) for %.2s: '%.100s' and '%.100s'",
27780  op_name,
27781  Py_TYPE(x)->tp_name,
27782  Py_TYPE(y)->tp_name);
27783  return NULL;
27784 }
27785 static PyObject* __Pyx_PyNumber_InPlaceMatrixMultiply(PyObject* x, PyObject* y) {
27786  __Pyx_TryMatrixMethod(x, y, __pyx_n_s_imatmul)
27787  return __Pyx__PyNumber_MatrixMultiply(x, y, "@=");
27788 }
27789 #undef __Pyx_TryMatrixMethod
27790 #endif
27791 
27792 /* ObjectGetItem */
27793 #if CYTHON_USE_TYPE_SLOTS
27794 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
27795  PyObject *runerr = NULL;
27796  Py_ssize_t key_value;
27797  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
27798  if (unlikely(!(m && m->sq_item))) {
27799  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
27800  return NULL;
27801  }
27802  key_value = __Pyx_PyIndex_AsSsize_t(index);
27803  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
27804  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
27805  }
27806  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
27807  PyErr_Clear();
27808  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
27809  }
27810  return NULL;
27811 }
27812 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
27813  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
27814  if (likely(m && m->mp_subscript)) {
27815  return m->mp_subscript(obj, key);
27816  }
27817  return __Pyx_PyObject_GetIndex(obj, key);
27818 }
27819 #endif
27820 
27821 /* SetItemInt */
27822 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
27823  int r;
27824  if (!j) return -1;
27825  r = PyObject_SetItem(o, j, v);
27826  Py_DECREF(j);
27827  return r;
27828 }
27829 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
27830  CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
27831 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
27832  if (is_list || PyList_CheckExact(o)) {
27833  Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
27834  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
27835  PyObject* old = PyList_GET_ITEM(o, n);
27836  Py_INCREF(v);
27837  PyList_SET_ITEM(o, n, v);
27838  Py_DECREF(old);
27839  return 1;
27840  }
27841  } else {
27842  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
27843  if (likely(m && m->sq_ass_item)) {
27844  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
27845  Py_ssize_t l = m->sq_length(o);
27846  if (likely(l >= 0)) {
27847  i += l;
27848  } else {
27849  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27850  return -1;
27851  PyErr_Clear();
27852  }
27853  }
27854  return m->sq_ass_item(o, i, v);
27855  }
27856  }
27857 #else
27858 #if CYTHON_COMPILING_IN_PYPY
27859  if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
27860 #else
27861  if (is_list || PySequence_Check(o))
27862 #endif
27863  {
27864  return PySequence_SetItem(o, i, v);
27865  }
27866 #endif
27867  return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
27868 }
27869 
27870 /* MemviewSliceInit */
27871 static int
27872 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
27873  int ndim,
27874  __Pyx_memviewslice *memviewslice,
27875  int memview_is_new_reference)
27876 {
27877  __Pyx_RefNannyDeclarations
27878  int i, retval=-1;
27879  Py_buffer *buf = &memview->view;
27880  __Pyx_RefNannySetupContext("init_memviewslice", 0);
27881  if (unlikely(memviewslice->memview || memviewslice->data)) {
27882  PyErr_SetString(PyExc_ValueError,
27883  "memviewslice is already initialized!");
27884  goto fail;
27885  }
27886  if (buf->strides) {
27887  for (i = 0; i < ndim; i++) {
27888  memviewslice->strides[i] = buf->strides[i];
27889  }
27890  } else {
27891  Py_ssize_t stride = buf->itemsize;
27892  for (i = ndim - 1; i >= 0; i--) {
27893  memviewslice->strides[i] = stride;
27894  stride *= buf->shape[i];
27895  }
27896  }
27897  for (i = 0; i < ndim; i++) {
27898  memviewslice->shape[i] = buf->shape[i];
27899  if (buf->suboffsets) {
27900  memviewslice->suboffsets[i] = buf->suboffsets[i];
27901  } else {
27902  memviewslice->suboffsets[i] = -1;
27903  }
27904  }
27905  memviewslice->memview = memview;
27906  memviewslice->data = (char *)buf->buf;
27907  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
27908  Py_INCREF(memview);
27909  }
27910  retval = 0;
27911  goto no_fail;
27912 fail:
27913  memviewslice->memview = 0;
27914  memviewslice->data = 0;
27915  retval = -1;
27916 no_fail:
27917  __Pyx_RefNannyFinishContext();
27918  return retval;
27919 }
27920 #ifndef Py_NO_RETURN
27921 #define Py_NO_RETURN
27922 #endif
27923 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
27924  va_list vargs;
27925  char msg[200];
27926 #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
27927  va_start(vargs, fmt);
27928 #else
27929  va_start(vargs);
27930 #endif
27931  vsnprintf(msg, 200, fmt, vargs);
27932  va_end(vargs);
27933  Py_FatalError(msg);
27934 }
27935 static CYTHON_INLINE int
27936 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27937  PyThread_type_lock lock)
27938 {
27939  int result;
27940  PyThread_acquire_lock(lock, 1);
27941  result = (*acquisition_count)++;
27942  PyThread_release_lock(lock);
27943  return result;
27944 }
27945 static CYTHON_INLINE int
27946 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
27947  PyThread_type_lock lock)
27948 {
27949  int result;
27950  PyThread_acquire_lock(lock, 1);
27951  result = (*acquisition_count)--;
27952  PyThread_release_lock(lock);
27953  return result;
27954 }
27955 static CYTHON_INLINE void
27956 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
27957 {
27958  int first_time;
27959  struct __pyx_memoryview_obj *memview = memslice->memview;
27960  if (unlikely(!memview || (PyObject *) memview == Py_None))
27961  return;
27962  if (unlikely(__pyx_get_slice_count(memview) < 0))
27963  __pyx_fatalerror("Acquisition count is %d (line %d)",
27964  __pyx_get_slice_count(memview), lineno);
27965  first_time = __pyx_add_acquisition_count(memview) == 0;
27966  if (unlikely(first_time)) {
27967  if (have_gil) {
27968  Py_INCREF((PyObject *) memview);
27969  } else {
27970  PyGILState_STATE _gilstate = PyGILState_Ensure();
27971  Py_INCREF((PyObject *) memview);
27972  PyGILState_Release(_gilstate);
27973  }
27974  }
27975 }
27976 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
27977  int have_gil, int lineno) {
27978  int last_time;
27979  struct __pyx_memoryview_obj *memview = memslice->memview;
27980  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
27981  memslice->memview = NULL;
27982  return;
27983  }
27984  if (unlikely(__pyx_get_slice_count(memview) <= 0))
27985  __pyx_fatalerror("Acquisition count is %d (line %d)",
27986  __pyx_get_slice_count(memview), lineno);
27987  last_time = __pyx_sub_acquisition_count(memview) == 1;
27988  memslice->data = NULL;
27989  if (unlikely(last_time)) {
27990  if (have_gil) {
27991  Py_CLEAR(memslice->memview);
27992  } else {
27993  PyGILState_STATE _gilstate = PyGILState_Ensure();
27994  Py_CLEAR(memslice->memview);
27995  PyGILState_Release(_gilstate);
27996  }
27997  } else {
27998  memslice->memview = NULL;
27999  }
28000 }
28001 
28002 /* None */
28003 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
28004  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
28005 }
28006 
28007 /* ArgTypeTest */
28008 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
28009 {
28010  if (unlikely(!type)) {
28011  PyErr_SetString(PyExc_SystemError, "Missing type object");
28012  return 0;
28013  }
28014  else if (exact) {
28015  #if PY_MAJOR_VERSION == 2
28016  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
28017  #endif
28018  }
28019  else {
28020  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
28021  }
28022  PyErr_Format(PyExc_TypeError,
28023  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
28024  name, type->tp_name, Py_TYPE(obj)->tp_name);
28025  return 0;
28026 }
28027 
28028 /* UnicodeEquals */
28029 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
28030 #if CYTHON_COMPILING_IN_PYPY
28031  return PyObject_RichCompareBool(s1, s2, equals);
28032 #else
28033 #if PY_MAJOR_VERSION < 3
28034  PyObject* owned_ref = NULL;
28035 #endif
28036  int s1_is_unicode, s2_is_unicode;
28037  if (s1 == s2) {
28038  goto return_eq;
28039  }
28040  s1_is_unicode = PyUnicode_CheckExact(s1);
28041  s2_is_unicode = PyUnicode_CheckExact(s2);
28042 #if PY_MAJOR_VERSION < 3
28043  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
28044  owned_ref = PyUnicode_FromObject(s2);
28045  if (unlikely(!owned_ref))
28046  return -1;
28047  s2 = owned_ref;
28048  s2_is_unicode = 1;
28049  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
28050  owned_ref = PyUnicode_FromObject(s1);
28051  if (unlikely(!owned_ref))
28052  return -1;
28053  s1 = owned_ref;
28054  s1_is_unicode = 1;
28055  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
28056  return __Pyx_PyBytes_Equals(s1, s2, equals);
28057  }
28058 #endif
28059  if (s1_is_unicode & s2_is_unicode) {
28060  Py_ssize_t length;
28061  int kind;
28062  void *data1, *data2;
28063  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
28064  return -1;
28065  length = __Pyx_PyUnicode_GET_LENGTH(s1);
28066  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
28067  goto return_ne;
28068  }
28069 #if CYTHON_USE_UNICODE_INTERNALS
28070  {
28071  Py_hash_t hash1, hash2;
28072  #if CYTHON_PEP393_ENABLED
28073  hash1 = ((PyASCIIObject*)s1)->hash;
28074  hash2 = ((PyASCIIObject*)s2)->hash;
28075  #else
28076  hash1 = ((PyUnicodeObject*)s1)->hash;
28077  hash2 = ((PyUnicodeObject*)s2)->hash;
28078  #endif
28079  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
28080  goto return_ne;
28081  }
28082  }
28083 #endif
28084  kind = __Pyx_PyUnicode_KIND(s1);
28085  if (kind != __Pyx_PyUnicode_KIND(s2)) {
28086  goto return_ne;
28087  }
28088  data1 = __Pyx_PyUnicode_DATA(s1);
28089  data2 = __Pyx_PyUnicode_DATA(s2);
28090  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
28091  goto return_ne;
28092  } else if (length == 1) {
28093  goto return_eq;
28094  } else {
28095  int result = memcmp(data1, data2, (size_t)(length * kind));
28096  #if PY_MAJOR_VERSION < 3
28097  Py_XDECREF(owned_ref);
28098  #endif
28099  return (equals == Py_EQ) ? (result == 0) : (result != 0);
28100  }
28101  } else if ((s1 == Py_None) & s2_is_unicode) {
28102  goto return_ne;
28103  } else if ((s2 == Py_None) & s1_is_unicode) {
28104  goto return_ne;
28105  } else {
28106  int result;
28107  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
28108  #if PY_MAJOR_VERSION < 3
28109  Py_XDECREF(owned_ref);
28110  #endif
28111  if (!py_result)
28112  return -1;
28113  result = __Pyx_PyObject_IsTrue(py_result);
28114  Py_DECREF(py_result);
28115  return result;
28116  }
28117 return_eq:
28118  #if PY_MAJOR_VERSION < 3
28119  Py_XDECREF(owned_ref);
28120  #endif
28121  return (equals == Py_EQ);
28122 return_ne:
28123  #if PY_MAJOR_VERSION < 3
28124  Py_XDECREF(owned_ref);
28125  #endif
28126  return (equals == Py_NE);
28127 #endif
28128 }
28129 
28130 /* WriteUnraisableException */
28131 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
28132  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
28133  int full_traceback, CYTHON_UNUSED int nogil) {
28134  PyObject *old_exc, *old_val, *old_tb;
28135  PyObject *ctx;
28136  __Pyx_PyThreadState_declare
28137 #ifdef WITH_THREAD
28138  PyGILState_STATE state;
28139  if (nogil)
28140  state = PyGILState_Ensure();
28141  else state = (PyGILState_STATE)0;
28142 #endif
28143  __Pyx_PyThreadState_assign
28144  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
28145  if (full_traceback) {
28146  Py_XINCREF(old_exc);
28147  Py_XINCREF(old_val);
28148  Py_XINCREF(old_tb);
28149  __Pyx_ErrRestore(old_exc, old_val, old_tb);
28150  PyErr_PrintEx(1);
28151  }
28152  #if PY_MAJOR_VERSION < 3
28153  ctx = PyString_FromString(name);
28154  #else
28155  ctx = PyUnicode_FromString(name);
28156  #endif
28157  __Pyx_ErrRestore(old_exc, old_val, old_tb);
28158  if (!ctx) {
28159  PyErr_WriteUnraisable(Py_None);
28160  } else {
28161  PyErr_WriteUnraisable(ctx);
28162  Py_DECREF(ctx);
28163  }
28164 #ifdef WITH_THREAD
28165  if (nogil)
28166  PyGILState_Release(state);
28167 #endif
28168 }
28169 
28170 /* GetAttr */
28171 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
28172 #if CYTHON_USE_TYPE_SLOTS
28173 #if PY_MAJOR_VERSION >= 3
28174  if (likely(PyUnicode_Check(n)))
28175 #else
28176  if (likely(PyString_Check(n)))
28177 #endif
28178  return __Pyx_PyObject_GetAttrStr(o, n);
28179 #endif
28180  return PyObject_GetAttr(o, n);
28181 }
28182 
28183 /* decode_c_string */
28184 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
28185  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
28186  const char* encoding, const char* errors,
28187  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
28188  Py_ssize_t length;
28189  if (unlikely((start < 0) | (stop < 0))) {
28190  size_t slen = strlen(cstring);
28191  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
28192  PyErr_SetString(PyExc_OverflowError,
28193  "c-string too long to convert to Python");
28194  return NULL;
28195  }
28196  length = (Py_ssize_t) slen;
28197  if (start < 0) {
28198  start += length;
28199  if (start < 0)
28200  start = 0;
28201  }
28202  if (stop < 0)
28203  stop += length;
28204  }
28205  if (unlikely(stop <= start))
28206  return __Pyx_NewRef(__pyx_empty_unicode);
28207  length = stop - start;
28208  cstring += start;
28209  if (decode_func) {
28210  return decode_func(cstring, length, errors);
28211  } else {
28212  return PyUnicode_Decode(cstring, length, encoding, errors);
28213  }
28214 }
28215 
28216 /* PyErrExceptionMatches */
28217 #if CYTHON_FAST_THREAD_STATE
28218 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28219  Py_ssize_t i, n;
28220  n = PyTuple_GET_SIZE(tuple);
28221 #if PY_MAJOR_VERSION >= 3
28222  for (i=0; i<n; i++) {
28223  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28224  }
28225 #endif
28226  for (i=0; i<n; i++) {
28227  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
28228  }
28229  return 0;
28230 }
28231 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
28232  PyObject *exc_type = tstate->curexc_type;
28233  if (exc_type == err) return 1;
28234  if (unlikely(!exc_type)) return 0;
28235  if (unlikely(PyTuple_Check(err)))
28236  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
28237  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
28238 }
28239 #endif
28240 
28241 /* GetAttr3 */
28242 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
28243  __Pyx_PyThreadState_declare
28244  __Pyx_PyThreadState_assign
28245  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28246  return NULL;
28247  __Pyx_PyErr_Clear();
28248  Py_INCREF(d);
28249  return d;
28250 }
28251 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
28252  PyObject *r = __Pyx_GetAttr(o, n);
28253  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
28254 }
28255 
28256 /* RaiseNoneIterError */
28257 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
28258  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
28259 }
28260 
28261 /* ExtTypeTest */
28262 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
28263  if (unlikely(!type)) {
28264  PyErr_SetString(PyExc_SystemError, "Missing type object");
28265  return 0;
28266  }
28267  if (likely(__Pyx_TypeCheck(obj, type)))
28268  return 1;
28269  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
28270  Py_TYPE(obj)->tp_name, type->tp_name);
28271  return 0;
28272 }
28273 
28274 /* GetTopmostException */
28275 #if CYTHON_USE_EXC_INFO_STACK
28276 static _PyErr_StackItem *
28277 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
28278 {
28279  _PyErr_StackItem *exc_info = tstate->exc_info;
28280  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
28281  exc_info->previous_item != NULL)
28282  {
28283  exc_info = exc_info->previous_item;
28284  }
28285  return exc_info;
28286 }
28287 #endif
28288 
28289 /* SaveResetException */
28290 #if CYTHON_FAST_THREAD_STATE
28291 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28292  #if CYTHON_USE_EXC_INFO_STACK
28293  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
28294  *type = exc_info->exc_type;
28295  *value = exc_info->exc_value;
28296  *tb = exc_info->exc_traceback;
28297  #else
28298  *type = tstate->exc_type;
28299  *value = tstate->exc_value;
28300  *tb = tstate->exc_traceback;
28301  #endif
28302  Py_XINCREF(*type);
28303  Py_XINCREF(*value);
28304  Py_XINCREF(*tb);
28305 }
28306 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
28307  PyObject *tmp_type, *tmp_value, *tmp_tb;
28308  #if CYTHON_USE_EXC_INFO_STACK
28309  _PyErr_StackItem *exc_info = tstate->exc_info;
28310  tmp_type = exc_info->exc_type;
28311  tmp_value = exc_info->exc_value;
28312  tmp_tb = exc_info->exc_traceback;
28313  exc_info->exc_type = type;
28314  exc_info->exc_value = value;
28315  exc_info->exc_traceback = tb;
28316  #else
28317  tmp_type = tstate->exc_type;
28318  tmp_value = tstate->exc_value;
28319  tmp_tb = tstate->exc_traceback;
28320  tstate->exc_type = type;
28321  tstate->exc_value = value;
28322  tstate->exc_traceback = tb;
28323  #endif
28324  Py_XDECREF(tmp_type);
28325  Py_XDECREF(tmp_value);
28326  Py_XDECREF(tmp_tb);
28327 }
28328 #endif
28329 
28330 /* GetException */
28331 #if CYTHON_FAST_THREAD_STATE
28332 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
28333 #else
28334 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
28335 #endif
28336 {
28337  PyObject *local_type, *local_value, *local_tb;
28338 #if CYTHON_FAST_THREAD_STATE
28339  PyObject *tmp_type, *tmp_value, *tmp_tb;
28340  local_type = tstate->curexc_type;
28341  local_value = tstate->curexc_value;
28342  local_tb = tstate->curexc_traceback;
28343  tstate->curexc_type = 0;
28344  tstate->curexc_value = 0;
28345  tstate->curexc_traceback = 0;
28346 #else
28347  PyErr_Fetch(&local_type, &local_value, &local_tb);
28348 #endif
28349  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
28350 #if CYTHON_FAST_THREAD_STATE
28351  if (unlikely(tstate->curexc_type))
28352 #else
28353  if (unlikely(PyErr_Occurred()))
28354 #endif
28355  goto bad;
28356  #if PY_MAJOR_VERSION >= 3
28357  if (local_tb) {
28358  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
28359  goto bad;
28360  }
28361  #endif
28362  Py_XINCREF(local_tb);
28363  Py_XINCREF(local_type);
28364  Py_XINCREF(local_value);
28365  *type = local_type;
28366  *value = local_value;
28367  *tb = local_tb;
28368 #if CYTHON_FAST_THREAD_STATE
28369  #if CYTHON_USE_EXC_INFO_STACK
28370  {
28371  _PyErr_StackItem *exc_info = tstate->exc_info;
28372  tmp_type = exc_info->exc_type;
28373  tmp_value = exc_info->exc_value;
28374  tmp_tb = exc_info->exc_traceback;
28375  exc_info->exc_type = local_type;
28376  exc_info->exc_value = local_value;
28377  exc_info->exc_traceback = local_tb;
28378  }
28379  #else
28380  tmp_type = tstate->exc_type;
28381  tmp_value = tstate->exc_value;
28382  tmp_tb = tstate->exc_traceback;
28383  tstate->exc_type = local_type;
28384  tstate->exc_value = local_value;
28385  tstate->exc_traceback = local_tb;
28386  #endif
28387  Py_XDECREF(tmp_type);
28388  Py_XDECREF(tmp_value);
28389  Py_XDECREF(tmp_tb);
28390 #else
28391  PyErr_SetExcInfo(local_type, local_value, local_tb);
28392 #endif
28393  return 0;
28394 bad:
28395  *type = 0;
28396  *value = 0;
28397  *tb = 0;
28398  Py_XDECREF(local_type);
28399  Py_XDECREF(local_value);
28400  Py_XDECREF(local_tb);
28401  return -1;
28402 }
28403 
28404 /* SwapException */
28405 #if CYTHON_FAST_THREAD_STATE
28406 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
28407  PyObject *tmp_type, *tmp_value, *tmp_tb;
28408  #if CYTHON_USE_EXC_INFO_STACK
28409  _PyErr_StackItem *exc_info = tstate->exc_info;
28410  tmp_type = exc_info->exc_type;
28411  tmp_value = exc_info->exc_value;
28412  tmp_tb = exc_info->exc_traceback;
28413  exc_info->exc_type = *type;
28414  exc_info->exc_value = *value;
28415  exc_info->exc_traceback = *tb;
28416  #else
28417  tmp_type = tstate->exc_type;
28418  tmp_value = tstate->exc_value;
28419  tmp_tb = tstate->exc_traceback;
28420  tstate->exc_type = *type;
28421  tstate->exc_value = *value;
28422  tstate->exc_traceback = *tb;
28423  #endif
28424  *type = tmp_type;
28425  *value = tmp_value;
28426  *tb = tmp_tb;
28427 }
28428 #else
28429 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
28430  PyObject *tmp_type, *tmp_value, *tmp_tb;
28431  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
28432  PyErr_SetExcInfo(*type, *value, *tb);
28433  *type = tmp_type;
28434  *value = tmp_value;
28435  *tb = tmp_tb;
28436 }
28437 #endif
28438 
28439 /* Import */
28440 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
28441  PyObject *empty_list = 0;
28442  PyObject *module = 0;
28443  PyObject *global_dict = 0;
28444  PyObject *empty_dict = 0;
28445  PyObject *list;
28446  #if PY_MAJOR_VERSION < 3
28447  PyObject *py_import;
28448  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
28449  if (!py_import)
28450  goto bad;
28451  #endif
28452  if (from_list)
28453  list = from_list;
28454  else {
28455  empty_list = PyList_New(0);
28456  if (!empty_list)
28457  goto bad;
28458  list = empty_list;
28459  }
28460  global_dict = PyModule_GetDict(__pyx_m);
28461  if (!global_dict)
28462  goto bad;
28463  empty_dict = PyDict_New();
28464  if (!empty_dict)
28465  goto bad;
28466  {
28467  #if PY_MAJOR_VERSION >= 3
28468  if (level == -1) {
28469  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
28470  module = PyImport_ImportModuleLevelObject(
28471  name, global_dict, empty_dict, list, 1);
28472  if (!module) {
28473  if (!PyErr_ExceptionMatches(PyExc_ImportError))
28474  goto bad;
28475  PyErr_Clear();
28476  }
28477  }
28478  level = 0;
28479  }
28480  #endif
28481  if (!module) {
28482  #if PY_MAJOR_VERSION < 3
28483  PyObject *py_level = PyInt_FromLong(level);
28484  if (!py_level)
28485  goto bad;
28486  module = PyObject_CallFunctionObjArgs(py_import,
28487  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
28488  Py_DECREF(py_level);
28489  #else
28490  module = PyImport_ImportModuleLevelObject(
28491  name, global_dict, empty_dict, list, level);
28492  #endif
28493  }
28494  }
28495 bad:
28496  #if PY_MAJOR_VERSION < 3
28497  Py_XDECREF(py_import);
28498  #endif
28499  Py_XDECREF(empty_list);
28500  Py_XDECREF(empty_dict);
28501  return module;
28502 }
28503 
28504 /* FastTypeChecks */
28505 #if CYTHON_COMPILING_IN_CPYTHON
28506 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28507  while (a) {
28508  a = a->tp_base;
28509  if (a == b)
28510  return 1;
28511  }
28512  return b == &PyBaseObject_Type;
28513 }
28514 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28515  PyObject *mro;
28516  if (a == b) return 1;
28517  mro = a->tp_mro;
28518  if (likely(mro)) {
28519  Py_ssize_t i, n;
28520  n = PyTuple_GET_SIZE(mro);
28521  for (i = 0; i < n; i++) {
28522  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28523  return 1;
28524  }
28525  return 0;
28526  }
28527  return __Pyx_InBases(a, b);
28528 }
28529 #if PY_MAJOR_VERSION == 2
28530 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
28531  PyObject *exception, *value, *tb;
28532  int res;
28533  __Pyx_PyThreadState_declare
28534  __Pyx_PyThreadState_assign
28535  __Pyx_ErrFetch(&exception, &value, &tb);
28536  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
28537  if (unlikely(res == -1)) {
28538  PyErr_WriteUnraisable(err);
28539  res = 0;
28540  }
28541  if (!res) {
28542  res = PyObject_IsSubclass(err, exc_type2);
28543  if (unlikely(res == -1)) {
28544  PyErr_WriteUnraisable(err);
28545  res = 0;
28546  }
28547  }
28548  __Pyx_ErrRestore(exception, value, tb);
28549  return res;
28550 }
28551 #else
28552 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28553  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
28554  if (!res) {
28555  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28556  }
28557  return res;
28558 }
28559 #endif
28560 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28561  Py_ssize_t i, n;
28562  assert(PyExceptionClass_Check(exc_type));
28563  n = PyTuple_GET_SIZE(tuple);
28564 #if PY_MAJOR_VERSION >= 3
28565  for (i=0; i<n; i++) {
28566  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28567  }
28568 #endif
28569  for (i=0; i<n; i++) {
28570  PyObject *t = PyTuple_GET_ITEM(tuple, i);
28571  #if PY_MAJOR_VERSION < 3
28572  if (likely(exc_type == t)) return 1;
28573  #endif
28574  if (likely(PyExceptionClass_Check(t))) {
28575  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
28576  } else {
28577  }
28578  }
28579  return 0;
28580 }
28581 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28582  if (likely(err == exc_type)) return 1;
28583  if (likely(PyExceptionClass_Check(err))) {
28584  if (likely(PyExceptionClass_Check(exc_type))) {
28585  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28586  } else if (likely(PyTuple_Check(exc_type))) {
28587  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28588  } else {
28589  }
28590  }
28591  return PyErr_GivenExceptionMatches(err, exc_type);
28592 }
28593 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28594  assert(PyExceptionClass_Check(exc_type1));
28595  assert(PyExceptionClass_Check(exc_type2));
28596  if (likely(err == exc_type1 || err == exc_type2)) return 1;
28597  if (likely(PyExceptionClass_Check(err))) {
28598  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28599  }
28600  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28601 }
28602 #endif
28603 
28604 /* PyIntBinop */
28605 #if !CYTHON_COMPILING_IN_PYPY
28606 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
28607  (void)inplace;
28608  (void)zerodivision_check;
28609  #if PY_MAJOR_VERSION < 3
28610  if (likely(PyInt_CheckExact(op1))) {
28611  const long b = intval;
28612  long x;
28613  long a = PyInt_AS_LONG(op1);
28614  x = (long)((unsigned long)a + b);
28615  if (likely((x^a) >= 0 || (x^b) >= 0))
28616  return PyInt_FromLong(x);
28617  return PyLong_Type.tp_as_number->nb_add(op1, op2);
28618  }
28619  #endif
28620  #if CYTHON_USE_PYLONG_INTERNALS
28621  if (likely(PyLong_CheckExact(op1))) {
28622  const long b = intval;
28623  long a, x;
28624 #ifdef HAVE_LONG_LONG
28625  const PY_LONG_LONG llb = intval;
28626  PY_LONG_LONG lla, llx;
28627 #endif
28628  const digit* digits = ((PyLongObject*)op1)->ob_digit;
28629  const Py_ssize_t size = Py_SIZE(op1);
28630  if (likely(__Pyx_sst_abs(size) <= 1)) {
28631  a = likely(size) ? digits[0] : 0;
28632  if (size == -1) a = -a;
28633  } else {
28634  switch (size) {
28635  case -2:
28636  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28637  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28638  break;
28639 #ifdef HAVE_LONG_LONG
28640  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
28641  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28642  goto long_long;
28643 #endif
28644  }
28645  CYTHON_FALLTHROUGH;
28646  case 2:
28647  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28648  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28649  break;
28650 #ifdef HAVE_LONG_LONG
28651  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
28652  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28653  goto long_long;
28654 #endif
28655  }
28656  CYTHON_FALLTHROUGH;
28657  case -3:
28658  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28659  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28660  break;
28661 #ifdef HAVE_LONG_LONG
28662  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
28663  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28664  goto long_long;
28665 #endif
28666  }
28667  CYTHON_FALLTHROUGH;
28668  case 3:
28669  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28670  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28671  break;
28672 #ifdef HAVE_LONG_LONG
28673  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
28674  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28675  goto long_long;
28676 #endif
28677  }
28678  CYTHON_FALLTHROUGH;
28679  case -4:
28680  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28681  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28682  break;
28683 #ifdef HAVE_LONG_LONG
28684  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
28685  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28686  goto long_long;
28687 #endif
28688  }
28689  CYTHON_FALLTHROUGH;
28690  case 4:
28691  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28692  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
28693  break;
28694 #ifdef HAVE_LONG_LONG
28695  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
28696  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
28697  goto long_long;
28698 #endif
28699  }
28700  CYTHON_FALLTHROUGH;
28701  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
28702  }
28703  }
28704  x = a + b;
28705  return PyLong_FromLong(x);
28706 #ifdef HAVE_LONG_LONG
28707  long_long:
28708  llx = lla + llb;
28709  return PyLong_FromLongLong(llx);
28710 #endif
28711 
28712 
28713  }
28714  #endif
28715  if (PyFloat_CheckExact(op1)) {
28716  const long b = intval;
28717  double a = PyFloat_AS_DOUBLE(op1);
28718  double result;
28719  PyFPE_START_PROTECT("add", return NULL)
28720  result = ((double)a) + (double)b;
28721  PyFPE_END_PROTECT(result)
28722  return PyFloat_FromDouble(result);
28723  }
28724  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
28725 }
28726 #endif
28727 
28728 /* ImportFrom */
28729 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
28730  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
28731  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
28732  PyErr_Format(PyExc_ImportError,
28733  #if PY_MAJOR_VERSION < 3
28734  "cannot import name %.230s", PyString_AS_STRING(name));
28735  #else
28736  "cannot import name %S", name);
28737  #endif
28738  }
28739  return value;
28740 }
28741 
28742 /* HasAttr */
28743 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
28744  PyObject *r;
28745  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
28746  PyErr_SetString(PyExc_TypeError,
28747  "hasattr(): attribute name must be string");
28748  return -1;
28749  }
28750  r = __Pyx_GetAttr(o, n);
28751  if (unlikely(!r)) {
28752  PyErr_Clear();
28753  return 0;
28754  } else {
28755  Py_DECREF(r);
28756  return 1;
28757  }
28758 }
28759 
28760 /* PyObject_GenericGetAttrNoDict */
28761 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
28762 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
28763  PyErr_Format(PyExc_AttributeError,
28764 #if PY_MAJOR_VERSION >= 3
28765  "'%.50s' object has no attribute '%U'",
28766  tp->tp_name, attr_name);
28767 #else
28768  "'%.50s' object has no attribute '%.400s'",
28769  tp->tp_name, PyString_AS_STRING(attr_name));
28770 #endif
28771  return NULL;
28772 }
28773 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
28774  PyObject *descr;
28775  PyTypeObject *tp = Py_TYPE(obj);
28776  if (unlikely(!PyString_Check(attr_name))) {
28777  return PyObject_GenericGetAttr(obj, attr_name);
28778  }
28779  assert(!tp->tp_dictoffset);
28780  descr = _PyType_Lookup(tp, attr_name);
28781  if (unlikely(!descr)) {
28782  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
28783  }
28784  Py_INCREF(descr);
28785  #if PY_MAJOR_VERSION < 3
28786  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
28787  #endif
28788  {
28789  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
28790  if (unlikely(f)) {
28791  PyObject *res = f(descr, obj, (PyObject *)tp);
28792  Py_DECREF(descr);
28793  return res;
28794  }
28795  }
28796  return descr;
28797 }
28798 #endif
28799 
28800 /* PyObject_GenericGetAttr */
28801 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
28802 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
28803  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
28804  return PyObject_GenericGetAttr(obj, attr_name);
28805  }
28806  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
28807 }
28808 #endif
28809 
28810 /* SetVTable */
28811 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
28812 #if PY_VERSION_HEX >= 0x02070000
28813  PyObject *ob = PyCapsule_New(vtable, 0, 0);
28814 #else
28815  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
28816 #endif
28817  if (!ob)
28818  goto bad;
28819  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
28820  goto bad;
28821  Py_DECREF(ob);
28822  return 0;
28823 bad:
28824  Py_XDECREF(ob);
28825  return -1;
28826 }
28827 
28828 /* PyObjectGetAttrStrNoError */
28829 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
28830  __Pyx_PyThreadState_declare
28831  __Pyx_PyThreadState_assign
28832  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
28833  __Pyx_PyErr_Clear();
28834 }
28835 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
28836  PyObject *result;
28837 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
28838  PyTypeObject* tp = Py_TYPE(obj);
28839  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
28840  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
28841  }
28842 #endif
28843  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
28844  if (unlikely(!result)) {
28845  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
28846  }
28847  return result;
28848 }
28849 
28850 /* SetupReduce */
28851 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
28852  int ret;
28853  PyObject *name_attr;
28854  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
28855  if (likely(name_attr)) {
28856  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
28857  } else {
28858  ret = -1;
28859  }
28860  if (unlikely(ret < 0)) {
28861  PyErr_Clear();
28862  ret = 0;
28863  }
28864  Py_XDECREF(name_attr);
28865  return ret;
28866 }
28867 static int __Pyx_setup_reduce(PyObject* type_obj) {
28868  int ret = 0;
28869  PyObject *object_reduce = NULL;
28870  PyObject *object_getstate = NULL;
28871  PyObject *object_reduce_ex = NULL;
28872  PyObject *reduce = NULL;
28873  PyObject *reduce_ex = NULL;
28874  PyObject *reduce_cython = NULL;
28875  PyObject *setstate = NULL;
28876  PyObject *setstate_cython = NULL;
28877  PyObject *getstate = NULL;
28878 #if CYTHON_USE_PYTYPE_LOOKUP
28879  getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
28880 #else
28881  getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
28882  if (!getstate && PyErr_Occurred()) {
28883  goto __PYX_BAD;
28884  }
28885 #endif
28886  if (getstate) {
28887 #if CYTHON_USE_PYTYPE_LOOKUP
28888  object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
28889 #else
28890  object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
28891  if (!object_getstate && PyErr_Occurred()) {
28892  goto __PYX_BAD;
28893  }
28894 #endif
28895  if (object_getstate != getstate) {
28896  goto __PYX_GOOD;
28897  }
28898  }
28899 #if CYTHON_USE_PYTYPE_LOOKUP
28900  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
28901 #else
28902  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
28903 #endif
28904  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
28905  if (reduce_ex == object_reduce_ex) {
28906 #if CYTHON_USE_PYTYPE_LOOKUP
28907  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
28908 #else
28909  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
28910 #endif
28911  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
28912  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
28913  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
28914  if (likely(reduce_cython)) {
28915  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28916  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28917  } else if (reduce == object_reduce || PyErr_Occurred()) {
28918  goto __PYX_BAD;
28919  }
28920  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
28921  if (!setstate) PyErr_Clear();
28922  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
28923  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
28924  if (likely(setstate_cython)) {
28925  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28926  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28927  } else if (!setstate || PyErr_Occurred()) {
28928  goto __PYX_BAD;
28929  }
28930  }
28931  PyType_Modified((PyTypeObject*)type_obj);
28932  }
28933  }
28934  goto __PYX_GOOD;
28935 __PYX_BAD:
28936  if (!PyErr_Occurred())
28937  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
28938  ret = -1;
28939 __PYX_GOOD:
28940 #if !CYTHON_USE_PYTYPE_LOOKUP
28941  Py_XDECREF(object_reduce);
28942  Py_XDECREF(object_reduce_ex);
28943  Py_XDECREF(object_getstate);
28944  Py_XDECREF(getstate);
28945 #endif
28946  Py_XDECREF(reduce);
28947  Py_XDECREF(reduce_ex);
28948  Py_XDECREF(reduce_cython);
28949  Py_XDECREF(setstate);
28950  Py_XDECREF(setstate_cython);
28951  return ret;
28952 }
28953 
28954 /* FetchCommonType */
28955 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
28956  PyObject* fake_module;
28957  PyTypeObject* cached_type = NULL;
28958  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
28959  if (!fake_module) return NULL;
28960  Py_INCREF(fake_module);
28961  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
28962  if (cached_type) {
28963  if (!PyType_Check((PyObject*)cached_type)) {
28964  PyErr_Format(PyExc_TypeError,
28965  "Shared Cython type %.200s is not a type object",
28966  type->tp_name);
28967  goto bad;
28968  }
28969  if (cached_type->tp_basicsize != type->tp_basicsize) {
28970  PyErr_Format(PyExc_TypeError,
28971  "Shared Cython type %.200s has the wrong size, try recompiling",
28972  type->tp_name);
28973  goto bad;
28974  }
28975  } else {
28976  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
28977  PyErr_Clear();
28978  if (PyType_Ready(type) < 0) goto bad;
28979  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
28980  goto bad;
28981  Py_INCREF(type);
28982  cached_type = type;
28983  }
28984 done:
28985  Py_DECREF(fake_module);
28986  return cached_type;
28987 bad:
28988  Py_XDECREF(cached_type);
28989  cached_type = NULL;
28990  goto done;
28991 }
28992 
28993 /* CythonFunctionShared */
28994 #include <structmember.h>
28995 static PyObject *
28996 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
28997 {
28998  if (unlikely(op->func_doc == NULL)) {
28999  if (op->func.m_ml->ml_doc) {
29000 #if PY_MAJOR_VERSION >= 3
29001  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
29002 #else
29003  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
29004 #endif
29005  if (unlikely(op->func_doc == NULL))
29006  return NULL;
29007  } else {
29008  Py_INCREF(Py_None);
29009  return Py_None;
29010  }
29011  }
29012  Py_INCREF(op->func_doc);
29013  return op->func_doc;
29014 }
29015 static int
29016 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
29017 {
29018  PyObject *tmp = op->func_doc;
29019  if (value == NULL) {
29020  value = Py_None;
29021  }
29022  Py_INCREF(value);
29023  op->func_doc = value;
29024  Py_XDECREF(tmp);
29025  return 0;
29026 }
29027 static PyObject *
29028 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
29029 {
29030  if (unlikely(op->func_name == NULL)) {
29031 #if PY_MAJOR_VERSION >= 3
29032  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
29033 #else
29034  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
29035 #endif
29036  if (unlikely(op->func_name == NULL))
29037  return NULL;
29038  }
29039  Py_INCREF(op->func_name);
29040  return op->func_name;
29041 }
29042 static int
29043 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
29044 {
29045  PyObject *tmp;
29046 #if PY_MAJOR_VERSION >= 3
29047  if (unlikely(value == NULL || !PyUnicode_Check(value)))
29048 #else
29049  if (unlikely(value == NULL || !PyString_Check(value)))
29050 #endif
29051  {
29052  PyErr_SetString(PyExc_TypeError,
29053  "__name__ must be set to a string object");
29054  return -1;
29055  }
29056  tmp = op->func_name;
29057  Py_INCREF(value);
29058  op->func_name = value;
29059  Py_XDECREF(tmp);
29060  return 0;
29061 }
29062 static PyObject *
29063 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
29064 {
29065  Py_INCREF(op->func_qualname);
29066  return op->func_qualname;
29067 }
29068 static int
29069 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
29070 {
29071  PyObject *tmp;
29072 #if PY_MAJOR_VERSION >= 3
29073  if (unlikely(value == NULL || !PyUnicode_Check(value)))
29074 #else
29075  if (unlikely(value == NULL || !PyString_Check(value)))
29076 #endif
29077  {
29078  PyErr_SetString(PyExc_TypeError,
29079  "__qualname__ must be set to a string object");
29080  return -1;
29081  }
29082  tmp = op->func_qualname;
29083  Py_INCREF(value);
29084  op->func_qualname = value;
29085  Py_XDECREF(tmp);
29086  return 0;
29087 }
29088 static PyObject *
29089 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
29090 {
29091  PyObject *self;
29092  self = m->func_closure;
29093  if (self == NULL)
29094  self = Py_None;
29095  Py_INCREF(self);
29096  return self;
29097 }
29098 static PyObject *
29099 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
29100 {
29101  if (unlikely(op->func_dict == NULL)) {
29102  op->func_dict = PyDict_New();
29103  if (unlikely(op->func_dict == NULL))
29104  return NULL;
29105  }
29106  Py_INCREF(op->func_dict);
29107  return op->func_dict;
29108 }
29109 static int
29110 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
29111 {
29112  PyObject *tmp;
29113  if (unlikely(value == NULL)) {
29114  PyErr_SetString(PyExc_TypeError,
29115  "function's dictionary may not be deleted");
29116  return -1;
29117  }
29118  if (unlikely(!PyDict_Check(value))) {
29119  PyErr_SetString(PyExc_TypeError,
29120  "setting function's dictionary to a non-dict");
29121  return -1;
29122  }
29123  tmp = op->func_dict;
29124  Py_INCREF(value);
29125  op->func_dict = value;
29126  Py_XDECREF(tmp);
29127  return 0;
29128 }
29129 static PyObject *
29130 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
29131 {
29132  Py_INCREF(op->func_globals);
29133  return op->func_globals;
29134 }
29135 static PyObject *
29136 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
29137 {
29138  Py_INCREF(Py_None);
29139  return Py_None;
29140 }
29141 static PyObject *
29142 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
29143 {
29144  PyObject* result = (op->func_code) ? op->func_code : Py_None;
29145  Py_INCREF(result);
29146  return result;
29147 }
29148 static int
29149 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
29150  int result = 0;
29151  PyObject *res = op->defaults_getter((PyObject *) op);
29152  if (unlikely(!res))
29153  return -1;
29154  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29155  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
29156  Py_INCREF(op->defaults_tuple);
29157  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
29158  Py_INCREF(op->defaults_kwdict);
29159  #else
29160  op->defaults_tuple = PySequence_ITEM(res, 0);
29161  if (unlikely(!op->defaults_tuple)) result = -1;
29162  else {
29163  op->defaults_kwdict = PySequence_ITEM(res, 1);
29164  if (unlikely(!op->defaults_kwdict)) result = -1;
29165  }
29166  #endif
29167  Py_DECREF(res);
29168  return result;
29169 }
29170 static int
29171 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
29172  PyObject* tmp;
29173  if (!value) {
29174  value = Py_None;
29175  } else if (value != Py_None && !PyTuple_Check(value)) {
29176  PyErr_SetString(PyExc_TypeError,
29177  "__defaults__ must be set to a tuple object");
29178  return -1;
29179  }
29180  Py_INCREF(value);
29181  tmp = op->defaults_tuple;
29182  op->defaults_tuple = value;
29183  Py_XDECREF(tmp);
29184  return 0;
29185 }
29186 static PyObject *
29187 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
29188  PyObject* result = op->defaults_tuple;
29189  if (unlikely(!result)) {
29190  if (op->defaults_getter) {
29191  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
29192  result = op->defaults_tuple;
29193  } else {
29194  result = Py_None;
29195  }
29196  }
29197  Py_INCREF(result);
29198  return result;
29199 }
29200 static int
29201 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
29202  PyObject* tmp;
29203  if (!value) {
29204  value = Py_None;
29205  } else if (value != Py_None && !PyDict_Check(value)) {
29206  PyErr_SetString(PyExc_TypeError,
29207  "__kwdefaults__ must be set to a dict object");
29208  return -1;
29209  }
29210  Py_INCREF(value);
29211  tmp = op->defaults_kwdict;
29212  op->defaults_kwdict = value;
29213  Py_XDECREF(tmp);
29214  return 0;
29215 }
29216 static PyObject *
29217 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
29218  PyObject* result = op->defaults_kwdict;
29219  if (unlikely(!result)) {
29220  if (op->defaults_getter) {
29221  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
29222  result = op->defaults_kwdict;
29223  } else {
29224  result = Py_None;
29225  }
29226  }
29227  Py_INCREF(result);
29228  return result;
29229 }
29230 static int
29231 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
29232  PyObject* tmp;
29233  if (!value || value == Py_None) {
29234  value = NULL;
29235  } else if (!PyDict_Check(value)) {
29236  PyErr_SetString(PyExc_TypeError,
29237  "__annotations__ must be set to a dict object");
29238  return -1;
29239  }
29240  Py_XINCREF(value);
29241  tmp = op->func_annotations;
29242  op->func_annotations = value;
29243  Py_XDECREF(tmp);
29244  return 0;
29245 }
29246 static PyObject *
29247 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
29248  PyObject* result = op->func_annotations;
29249  if (unlikely(!result)) {
29250  result = PyDict_New();
29251  if (unlikely(!result)) return NULL;
29252  op->func_annotations = result;
29253  }
29254  Py_INCREF(result);
29255  return result;
29256 }
29257 static PyGetSetDef __pyx_CyFunction_getsets[] = {
29258  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
29259  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
29260  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
29261  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
29262  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
29263  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
29264  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
29265  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
29266  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
29267  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
29268  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
29269  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
29270  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
29271  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
29272  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
29273  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
29274  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
29275  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
29276  {0, 0, 0, 0, 0}
29277 };
29278 static PyMemberDef __pyx_CyFunction_members[] = {
29279  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
29280  {0, 0, 0, 0, 0}
29281 };
29282 static PyObject *
29283 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
29284 {
29285 #if PY_MAJOR_VERSION >= 3
29286  Py_INCREF(m->func_qualname);
29287  return m->func_qualname;
29288 #else
29289  return PyString_FromString(m->func.m_ml->ml_name);
29290 #endif
29291 }
29292 static PyMethodDef __pyx_CyFunction_methods[] = {
29293  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
29294  {0, 0, 0, 0}
29295 };
29296 #if PY_VERSION_HEX < 0x030500A0
29297 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
29298 #else
29299 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
29300 #endif
29301 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
29302  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
29303  if (unlikely(op == NULL))
29304  return NULL;
29305  op->flags = flags;
29306  __Pyx_CyFunction_weakreflist(op) = NULL;
29307  op->func.m_ml = ml;
29308  op->func.m_self = (PyObject *) op;
29309  Py_XINCREF(closure);
29310  op->func_closure = closure;
29311  Py_XINCREF(module);
29312  op->func.m_module = module;
29313  op->func_dict = NULL;
29314  op->func_name = NULL;
29315  Py_INCREF(qualname);
29316  op->func_qualname = qualname;
29317  op->func_doc = NULL;
29318  op->func_classobj = NULL;
29319  op->func_globals = globals;
29320  Py_INCREF(op->func_globals);
29321  Py_XINCREF(code);
29322  op->func_code = code;
29323  op->defaults_pyobjects = 0;
29324  op->defaults_size = 0;
29325  op->defaults = NULL;
29326  op->defaults_tuple = NULL;
29327  op->defaults_kwdict = NULL;
29328  op->defaults_getter = NULL;
29329  op->func_annotations = NULL;
29330  return (PyObject *) op;
29331 }
29332 static int
29333 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
29334 {
29335  Py_CLEAR(m->func_closure);
29336  Py_CLEAR(m->func.m_module);
29337  Py_CLEAR(m->func_dict);
29338  Py_CLEAR(m->func_name);
29339  Py_CLEAR(m->func_qualname);
29340  Py_CLEAR(m->func_doc);
29341  Py_CLEAR(m->func_globals);
29342  Py_CLEAR(m->func_code);
29343  Py_CLEAR(m->func_classobj);
29344  Py_CLEAR(m->defaults_tuple);
29345  Py_CLEAR(m->defaults_kwdict);
29346  Py_CLEAR(m->func_annotations);
29347  if (m->defaults) {
29348  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
29349  int i;
29350  for (i = 0; i < m->defaults_pyobjects; i++)
29351  Py_XDECREF(pydefaults[i]);
29352  PyObject_Free(m->defaults);
29353  m->defaults = NULL;
29354  }
29355  return 0;
29356 }
29357 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
29358 {
29359  if (__Pyx_CyFunction_weakreflist(m) != NULL)
29360  PyObject_ClearWeakRefs((PyObject *) m);
29361  __Pyx_CyFunction_clear(m);
29362  PyObject_GC_Del(m);
29363 }
29364 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
29365 {
29366  PyObject_GC_UnTrack(m);
29367  __Pyx__CyFunction_dealloc(m);
29368 }
29369 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
29370 {
29371  Py_VISIT(m->func_closure);
29372  Py_VISIT(m->func.m_module);
29373  Py_VISIT(m->func_dict);
29374  Py_VISIT(m->func_name);
29375  Py_VISIT(m->func_qualname);
29376  Py_VISIT(m->func_doc);
29377  Py_VISIT(m->func_globals);
29378  Py_VISIT(m->func_code);
29379  Py_VISIT(m->func_classobj);
29380  Py_VISIT(m->defaults_tuple);
29381  Py_VISIT(m->defaults_kwdict);
29382  if (m->defaults) {
29383  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
29384  int i;
29385  for (i = 0; i < m->defaults_pyobjects; i++)
29386  Py_VISIT(pydefaults[i]);
29387  }
29388  return 0;
29389 }
29390 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
29391 {
29392 #if PY_MAJOR_VERSION < 3
29393  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29394  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
29395  Py_INCREF(func);
29396  return func;
29397  }
29398  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
29399  if (type == NULL)
29400  type = (PyObject *)(Py_TYPE(obj));
29401  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
29402  }
29403  if (obj == Py_None)
29404  obj = NULL;
29405 #endif
29406  return __Pyx_PyMethod_New(func, obj, type);
29407 }
29408 static PyObject*
29409 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
29410 {
29411 #if PY_MAJOR_VERSION >= 3
29412  return PyUnicode_FromFormat("<cyfunction %U at %p>",
29413  op->func_qualname, (void *)op);
29414 #else
29415  return PyString_FromFormat("<cyfunction %s at %p>",
29416  PyString_AsString(op->func_qualname), (void *)op);
29417 #endif
29418 }
29419 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
29420  PyCFunctionObject* f = (PyCFunctionObject*)func;
29421  PyCFunction meth = f->m_ml->ml_meth;
29422  Py_ssize_t size;
29423  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
29424  case METH_VARARGS:
29425  if (likely(kw == NULL || PyDict_Size(kw) == 0))
29426  return (*meth)(self, arg);
29427  break;
29428  case METH_VARARGS | METH_KEYWORDS:
29429  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
29430  case METH_NOARGS:
29431  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
29432  size = PyTuple_GET_SIZE(arg);
29433  if (likely(size == 0))
29434  return (*meth)(self, NULL);
29435  PyErr_Format(PyExc_TypeError,
29436  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
29437  f->m_ml->ml_name, size);
29438  return NULL;
29439  }
29440  break;
29441  case METH_O:
29442  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
29443  size = PyTuple_GET_SIZE(arg);
29444  if (likely(size == 1)) {
29445  PyObject *result, *arg0;
29446  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29447  arg0 = PyTuple_GET_ITEM(arg, 0);
29448  #else
29449  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
29450  #endif
29451  result = (*meth)(self, arg0);
29452  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
29453  Py_DECREF(arg0);
29454  #endif
29455  return result;
29456  }
29457  PyErr_Format(PyExc_TypeError,
29458  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
29459  f->m_ml->ml_name, size);
29460  return NULL;
29461  }
29462  break;
29463  default:
29464  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
29465  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
29466  "longer supported!");
29467  return NULL;
29468  }
29469  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
29470  f->m_ml->ml_name);
29471  return NULL;
29472 }
29473 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29474  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
29475 }
29476 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
29477  PyObject *result;
29478  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
29479  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
29480  Py_ssize_t argc;
29481  PyObject *new_args;
29482  PyObject *self;
29483  argc = PyTuple_GET_SIZE(args);
29484  new_args = PyTuple_GetSlice(args, 1, argc);
29485  if (unlikely(!new_args))
29486  return NULL;
29487  self = PyTuple_GetItem(args, 0);
29488  if (unlikely(!self)) {
29489  Py_DECREF(new_args);
29490 #if PY_MAJOR_VERSION > 2
29491  PyErr_Format(PyExc_TypeError,
29492  "unbound method %.200S() needs an argument",
29493  cyfunc->func_qualname);
29494 #else
29495  PyErr_SetString(PyExc_TypeError,
29496  "unbound method needs an argument");
29497 #endif
29498  return NULL;
29499  }
29500  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
29501  Py_DECREF(new_args);
29502  } else {
29503  result = __Pyx_CyFunction_Call(func, args, kw);
29504  }
29505  return result;
29506 }
29507 static PyTypeObject __pyx_CyFunctionType_type = {
29508  PyVarObject_HEAD_INIT(0, 0)
29509  "cython_function_or_method",
29510  sizeof(__pyx_CyFunctionObject),
29511  0,
29512  (destructor) __Pyx_CyFunction_dealloc,
29513  0,
29514  0,
29515  0,
29516 #if PY_MAJOR_VERSION < 3
29517  0,
29518 #else
29519  0,
29520 #endif
29521  (reprfunc) __Pyx_CyFunction_repr,
29522  0,
29523  0,
29524  0,
29525  0,
29526  __Pyx_CyFunction_CallAsMethod,
29527  0,
29528  0,
29529  0,
29530  0,
29531  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
29532  0,
29533  (traverseproc) __Pyx_CyFunction_traverse,
29534  (inquiry) __Pyx_CyFunction_clear,
29535  0,
29536 #if PY_VERSION_HEX < 0x030500A0
29537  offsetof(__pyx_CyFunctionObject, func_weakreflist),
29538 #else
29539  offsetof(PyCFunctionObject, m_weakreflist),
29540 #endif
29541  0,
29542  0,
29543  __pyx_CyFunction_methods,
29544  __pyx_CyFunction_members,
29545  __pyx_CyFunction_getsets,
29546  0,
29547  0,
29548  __Pyx_CyFunction_descr_get,
29549  0,
29550  offsetof(__pyx_CyFunctionObject, func_dict),
29551  0,
29552  0,
29553  0,
29554  0,
29555  0,
29556  0,
29557  0,
29558  0,
29559  0,
29560  0,
29561  0,
29562  0,
29563 #if PY_VERSION_HEX >= 0x030400a1
29564  0,
29565 #endif
29566 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
29567  0,
29568 #endif
29569 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
29570  0,
29571 #endif
29572 #if PY_VERSION_HEX >= 0x030C0000
29573  0,
29574 #endif
29575 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
29576  0,
29577 #endif
29578 };
29579 static int __pyx_CyFunction_init(void) {
29580  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
29581  if (unlikely(__pyx_CyFunctionType == NULL)) {
29582  return -1;
29583  }
29584  return 0;
29585 }
29586 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
29587  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29588  m->defaults = PyObject_Malloc(size);
29589  if (unlikely(!m->defaults))
29590  return PyErr_NoMemory();
29591  memset(m->defaults, 0, size);
29592  m->defaults_pyobjects = pyobjects;
29593  m->defaults_size = size;
29594  return m->defaults;
29595 }
29596 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
29597  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29598  m->defaults_tuple = tuple;
29599  Py_INCREF(tuple);
29600 }
29601 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
29602  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29603  m->defaults_kwdict = dict;
29604  Py_INCREF(dict);
29605 }
29606 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
29607  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
29608  m->func_annotations = dict;
29609  Py_INCREF(dict);
29610 }
29611 
29612 /* CythonFunction */
29613 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
29614  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
29615  PyObject *op = __Pyx_CyFunction_Init(
29616  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
29617  ml, flags, qualname, closure, module, globals, code
29618  );
29619  if (likely(op)) {
29620  PyObject_GC_Track(op);
29621  }
29622  return op;
29623 }
29624 
29625 /* CLineInTraceback */
29626 #ifndef CYTHON_CLINE_IN_TRACEBACK
29627 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
29628  PyObject *use_cline;
29629  PyObject *ptype, *pvalue, *ptraceback;
29630 #if CYTHON_COMPILING_IN_CPYTHON
29631  PyObject **cython_runtime_dict;
29632 #endif
29633  if (unlikely(!__pyx_cython_runtime)) {
29634  return c_line;
29635  }
29636  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
29637 #if CYTHON_COMPILING_IN_CPYTHON
29638  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
29639  if (likely(cython_runtime_dict)) {
29640  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
29641  use_cline, *cython_runtime_dict,
29642  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
29643  } else
29644 #endif
29645  {
29646  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
29647  if (use_cline_obj) {
29648  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
29649  Py_DECREF(use_cline_obj);
29650  } else {
29651  PyErr_Clear();
29652  use_cline = NULL;
29653  }
29654  }
29655  if (!use_cline) {
29656  c_line = 0;
29657  (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
29658  }
29659  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
29660  c_line = 0;
29661  }
29662  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
29663  return c_line;
29664 }
29665 #endif
29666 
29667 /* CodeObjectCache */
29668 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
29669  int start = 0, mid = 0, end = count - 1;
29670  if (end >= 0 && code_line > entries[end].code_line) {
29671  return count;
29672  }
29673  while (start < end) {
29674  mid = start + (end - start) / 2;
29675  if (code_line < entries[mid].code_line) {
29676  end = mid;
29677  } else if (code_line > entries[mid].code_line) {
29678  start = mid + 1;
29679  } else {
29680  return mid;
29681  }
29682  }
29683  if (code_line <= entries[mid].code_line) {
29684  return mid;
29685  } else {
29686  return mid + 1;
29687  }
29688 }
29689 static PyCodeObject *__pyx_find_code_object(int code_line) {
29690  PyCodeObject* code_object;
29691  int pos;
29692  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
29693  return NULL;
29694  }
29695  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
29696  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
29697  return NULL;
29698  }
29699  code_object = __pyx_code_cache.entries[pos].code_object;
29700  Py_INCREF(code_object);
29701  return code_object;
29702 }
29703 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
29704  int pos, i;
29705  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
29706  if (unlikely(!code_line)) {
29707  return;
29708  }
29709  if (unlikely(!entries)) {
29710  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
29711  if (likely(entries)) {
29712  __pyx_code_cache.entries = entries;
29713  __pyx_code_cache.max_count = 64;
29714  __pyx_code_cache.count = 1;
29715  entries[0].code_line = code_line;
29716  entries[0].code_object = code_object;
29717  Py_INCREF(code_object);
29718  }
29719  return;
29720  }
29721  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
29722  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
29723  PyCodeObject* tmp = entries[pos].code_object;
29724  entries[pos].code_object = code_object;
29725  Py_DECREF(tmp);
29726  return;
29727  }
29728  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
29729  int new_max = __pyx_code_cache.max_count + 64;
29730  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
29731  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
29732  if (unlikely(!entries)) {
29733  return;
29734  }
29735  __pyx_code_cache.entries = entries;
29736  __pyx_code_cache.max_count = new_max;
29737  }
29738  for (i=__pyx_code_cache.count; i>pos; i--) {
29739  entries[i] = entries[i-1];
29740  }
29741  entries[pos].code_line = code_line;
29742  entries[pos].code_object = code_object;
29743  __pyx_code_cache.count++;
29744  Py_INCREF(code_object);
29745 }
29746 
29747 /* AddTraceback */
29748 #include "compile.h"
29749 #include "frameobject.h"
29750 #include "traceback.h"
29751 #if PY_VERSION_HEX >= 0x030b00a6
29752  #ifndef Py_BUILD_CORE
29753  #define Py_BUILD_CORE 1
29754  #endif
29755  #include "internal/pycore_frame.h"
29756 #endif
29757 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
29758  const char *funcname, int c_line,
29759  int py_line, const char *filename) {
29760  PyCodeObject *py_code = NULL;
29761  PyObject *py_funcname = NULL;
29762  #if PY_MAJOR_VERSION < 3
29763  PyObject *py_srcfile = NULL;
29764  py_srcfile = PyString_FromString(filename);
29765  if (!py_srcfile) goto bad;
29766  #endif
29767  if (c_line) {
29768  #if PY_MAJOR_VERSION < 3
29769  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
29770  if (!py_funcname) goto bad;
29771  #else
29772  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
29773  if (!py_funcname) goto bad;
29774  funcname = PyUnicode_AsUTF8(py_funcname);
29775  if (!funcname) goto bad;
29776  #endif
29777  }
29778  else {
29779  #if PY_MAJOR_VERSION < 3
29780  py_funcname = PyString_FromString(funcname);
29781  if (!py_funcname) goto bad;
29782  #endif
29783  }
29784  #if PY_MAJOR_VERSION < 3
29785  py_code = __Pyx_PyCode_New(
29786  0,
29787  0,
29788  0,
29789  0,
29790  0,
29791  __pyx_empty_bytes, /*PyObject *code,*/
29792  __pyx_empty_tuple, /*PyObject *consts,*/
29793  __pyx_empty_tuple, /*PyObject *names,*/
29794  __pyx_empty_tuple, /*PyObject *varnames,*/
29795  __pyx_empty_tuple, /*PyObject *freevars,*/
29796  __pyx_empty_tuple, /*PyObject *cellvars,*/
29797  py_srcfile, /*PyObject *filename,*/
29798  py_funcname, /*PyObject *name,*/
29799  py_line,
29800  __pyx_empty_bytes /*PyObject *lnotab*/
29801  );
29802  Py_DECREF(py_srcfile);
29803  #else
29804  py_code = PyCode_NewEmpty(filename, funcname, py_line);
29805  #endif
29806  Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
29807  return py_code;
29808 bad:
29809  Py_XDECREF(py_funcname);
29810  #if PY_MAJOR_VERSION < 3
29811  Py_XDECREF(py_srcfile);
29812  #endif
29813  return NULL;
29814 }
29815 static void __Pyx_AddTraceback(const char *funcname, int c_line,
29816  int py_line, const char *filename) {
29817  PyCodeObject *py_code = 0;
29818  PyFrameObject *py_frame = 0;
29819  PyThreadState *tstate = __Pyx_PyThreadState_Current;
29820  PyObject *ptype, *pvalue, *ptraceback;
29821  if (c_line) {
29822  c_line = __Pyx_CLineForTraceback(tstate, c_line);
29823  }
29824  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
29825  if (!py_code) {
29826  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
29827  py_code = __Pyx_CreateCodeObjectForTraceback(
29828  funcname, c_line, py_line, filename);
29829  if (!py_code) {
29830  /* If the code object creation fails, then we should clear the
29831  fetched exception references and propagate the new exception */
29832  Py_XDECREF(ptype);
29833  Py_XDECREF(pvalue);
29834  Py_XDECREF(ptraceback);
29835  goto bad;
29836  }
29837  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
29838  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
29839  }
29840  py_frame = PyFrame_New(
29841  tstate, /*PyThreadState *tstate,*/
29842  py_code, /*PyCodeObject *code,*/
29843  __pyx_d, /*PyObject *globals,*/
29844  0 /*PyObject *locals*/
29845  );
29846  if (!py_frame) goto bad;
29847  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
29848  PyTraceBack_Here(py_frame);
29849 bad:
29850  Py_XDECREF(py_code);
29851  Py_XDECREF(py_frame);
29852 }
29853 
29854 #if PY_MAJOR_VERSION < 3
29855 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
29856  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
29857  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
29858  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
29859  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
29860  return -1;
29861 }
29862 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
29863  PyObject *obj = view->obj;
29864  if (!obj) return;
29865  if (PyObject_CheckBuffer(obj)) {
29866  PyBuffer_Release(view);
29867  return;
29868  }
29869  if ((0)) {}
29870  view->obj = NULL;
29871  Py_DECREF(obj);
29872 }
29873 #endif
29874 
29875 
29876 /* MemviewSliceIsContig */
29877 static int
29878 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
29879 {
29880  int i, index, step, start;
29881  Py_ssize_t itemsize = mvs.memview->view.itemsize;
29882  if (order == 'F') {
29883  step = 1;
29884  start = 0;
29885  } else {
29886  step = -1;
29887  start = ndim - 1;
29888  }
29889  for (i = 0; i < ndim; i++) {
29890  index = start + step * i;
29891  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
29892  return 0;
29893  itemsize *= mvs.shape[index];
29894  }
29895  return 1;
29896 }
29897 
29898 /* OverlappingSlices */
29899 static void
29900 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
29901  void **out_start, void **out_end,
29902  int ndim, size_t itemsize)
29903 {
29904  char *start, *end;
29905  int i;
29906  start = end = slice->data;
29907  for (i = 0; i < ndim; i++) {
29908  Py_ssize_t stride = slice->strides[i];
29909  Py_ssize_t extent = slice->shape[i];
29910  if (extent == 0) {
29911  *out_start = *out_end = start;
29912  return;
29913  } else {
29914  if (stride > 0)
29915  end += stride * (extent - 1);
29916  else
29917  start += stride * (extent - 1);
29918  }
29919  }
29920  *out_start = start;
29921  *out_end = end + itemsize;
29922 }
29923 static int
29924 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
29925  __Pyx_memviewslice *slice2,
29926  int ndim, size_t itemsize)
29927 {
29928  void *start1, *end1, *start2, *end2;
29929  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
29930  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
29931  return (start1 < end2) && (start2 < end1);
29932 }
29933 
29934 /* Capsule */
29935 static CYTHON_INLINE PyObject *
29936 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
29937 {
29938  PyObject *cobj;
29939 #if PY_VERSION_HEX >= 0x02070000
29940  cobj = PyCapsule_New(p, sig, NULL);
29941 #else
29942  cobj = PyCObject_FromVoidPtr(p, NULL);
29943 #endif
29944  return cobj;
29945 }
29946 
29947 /* IsLittleEndian */
29948 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
29949 {
29950  union {
29951  uint32_t u32;
29952  uint8_t u8[4];
29953  } S;
29954  S.u32 = 0x01020304;
29955  return S.u8[0] == 4;
29956 }
29957 
29958 /* BufferFormatCheck */
29959 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
29960  __Pyx_BufFmt_StackElem* stack,
29961  __Pyx_TypeInfo* type) {
29962  stack[0].field = &ctx->root;
29963  stack[0].parent_offset = 0;
29964  ctx->root.type = type;
29965  ctx->root.name = "buffer dtype";
29966  ctx->root.offset = 0;
29967  ctx->head = stack;
29968  ctx->head->field = &ctx->root;
29969  ctx->fmt_offset = 0;
29970  ctx->head->parent_offset = 0;
29971  ctx->new_packmode = '@';
29972  ctx->enc_packmode = '@';
29973  ctx->new_count = 1;
29974  ctx->enc_count = 0;
29975  ctx->enc_type = 0;
29976  ctx->is_complex = 0;
29977  ctx->is_valid_array = 0;
29978  ctx->struct_alignment = 0;
29979  while (type->typegroup == 'S') {
29980  ++ctx->head;
29981  ctx->head->field = type->fields;
29982  ctx->head->parent_offset = 0;
29983  type = type->fields->type;
29984  }
29985 }
29986 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
29987  int count;
29988  const char* t = *ts;
29989  if (*t < '0' || *t > '9') {
29990  return -1;
29991  } else {
29992  count = *t++ - '0';
29993  while (*t >= '0' && *t <= '9') {
29994  count *= 10;
29995  count += *t++ - '0';
29996  }
29997  }
29998  *ts = t;
29999  return count;
30000 }
30001 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
30002  int number = __Pyx_BufFmt_ParseNumber(ts);
30003  if (number == -1)
30004  PyErr_Format(PyExc_ValueError,\
30005  "Does not understand character buffer dtype format string ('%c')", **ts);
30006  return number;
30007 }
30008 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
30009  PyErr_Format(PyExc_ValueError,
30010  "Unexpected format string character: '%c'", ch);
30011 }
30012 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
30013  switch (ch) {
30014  case '?': return "'bool'";
30015  case 'c': return "'char'";
30016  case 'b': return "'signed char'";
30017  case 'B': return "'unsigned char'";
30018  case 'h': return "'short'";
30019  case 'H': return "'unsigned short'";
30020  case 'i': return "'int'";
30021  case 'I': return "'unsigned int'";
30022  case 'l': return "'long'";
30023  case 'L': return "'unsigned long'";
30024  case 'q': return "'long long'";
30025  case 'Q': return "'unsigned long long'";
30026  case 'f': return (is_complex ? "'complex float'" : "'float'");
30027  case 'd': return (is_complex ? "'complex double'" : "'double'");
30028  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
30029  case 'T': return "a struct";
30030  case 'O': return "Python object";
30031  case 'P': return "a pointer";
30032  case 's': case 'p': return "a string";
30033  case 0: return "end";
30034  default: return "unparseable format string";
30035  }
30036 }
30037 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
30038  switch (ch) {
30039  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30040  case 'h': case 'H': return 2;
30041  case 'i': case 'I': case 'l': case 'L': return 4;
30042  case 'q': case 'Q': return 8;
30043  case 'f': return (is_complex ? 8 : 4);
30044  case 'd': return (is_complex ? 16 : 8);
30045  case 'g': {
30046  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
30047  return 0;
30048  }
30049  case 'O': case 'P': return sizeof(void*);
30050  default:
30051  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30052  return 0;
30053  }
30054 }
30055 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
30056  switch (ch) {
30057  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30058  case 'h': case 'H': return sizeof(short);
30059  case 'i': case 'I': return sizeof(int);
30060  case 'l': case 'L': return sizeof(long);
30061  #ifdef HAVE_LONG_LONG
30062  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
30063  #endif
30064  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
30065  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
30066  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
30067  case 'O': case 'P': return sizeof(void*);
30068  default: {
30069  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30070  return 0;
30071  }
30072  }
30073 }
30074 typedef struct { char c; short x; } __Pyx_st_short;
30075 typedef struct { char c; int x; } __Pyx_st_int;
30076 typedef struct { char c; long x; } __Pyx_st_long;
30077 typedef struct { char c; float x; } __Pyx_st_float;
30078 typedef struct { char c; double x; } __Pyx_st_double;
30079 typedef struct { char c; long double x; } __Pyx_st_longdouble;
30080 typedef struct { char c; void *x; } __Pyx_st_void_p;
30081 #ifdef HAVE_LONG_LONG
30082 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
30083 #endif
30084 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
30085  switch (ch) {
30086  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30087  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
30088  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
30089  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
30090 #ifdef HAVE_LONG_LONG
30091  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
30092 #endif
30093  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
30094  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
30095  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
30096  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
30097  default:
30098  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30099  return 0;
30100  }
30101 }
30102 /* These are for computing the padding at the end of the struct to align
30103  on the first member of the struct. This will probably the same as above,
30104  but we don't have any guarantees.
30105  */
30106 typedef struct { short x; char c; } __Pyx_pad_short;
30107 typedef struct { int x; char c; } __Pyx_pad_int;
30108 typedef struct { long x; char c; } __Pyx_pad_long;
30109 typedef struct { float x; char c; } __Pyx_pad_float;
30110 typedef struct { double x; char c; } __Pyx_pad_double;
30111 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
30112 typedef struct { void *x; char c; } __Pyx_pad_void_p;
30113 #ifdef HAVE_LONG_LONG
30114 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
30115 #endif
30116 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
30117  switch (ch) {
30118  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
30119  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
30120  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
30121  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
30122 #ifdef HAVE_LONG_LONG
30123  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
30124 #endif
30125  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
30126  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
30127  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
30128  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
30129  default:
30130  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30131  return 0;
30132  }
30133 }
30134 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
30135  switch (ch) {
30136  case 'c':
30137  return 'H';
30138  case 'b': case 'h': case 'i':
30139  case 'l': case 'q': case 's': case 'p':
30140  return 'I';
30141  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
30142  return 'U';
30143  case 'f': case 'd': case 'g':
30144  return (is_complex ? 'C' : 'R');
30145  case 'O':
30146  return 'O';
30147  case 'P':
30148  return 'P';
30149  default: {
30150  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
30151  return 0;
30152  }
30153  }
30154 }
30155 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
30156  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
30157  const char* expected;
30158  const char* quote;
30159  if (ctx->head == NULL) {
30160  expected = "end";
30161  quote = "";
30162  } else {
30163  expected = ctx->head->field->type->name;
30164  quote = "'";
30165  }
30166  PyErr_Format(PyExc_ValueError,
30167  "Buffer dtype mismatch, expected %s%s%s but got %s",
30168  quote, expected, quote,
30169  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
30170  } else {
30171  __Pyx_StructField* field = ctx->head->field;
30172  __Pyx_StructField* parent = (ctx->head - 1)->field;
30173  PyErr_Format(PyExc_ValueError,
30174  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
30175  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
30176  parent->type->name, field->name);
30177  }
30178 }
30179 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
30180  char group;
30181  size_t size, offset, arraysize = 1;
30182  if (ctx->enc_type == 0) return 0;
30183  if (ctx->head->field->type->arraysize[0]) {
30184  int i, ndim = 0;
30185  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
30186  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
30187  ndim = 1;
30188  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
30189  PyErr_Format(PyExc_ValueError,
30190  "Expected a dimension of size %zu, got %zu",
30191  ctx->head->field->type->arraysize[0], ctx->enc_count);
30192  return -1;
30193  }
30194  }
30195  if (!ctx->is_valid_array) {
30196  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
30197  ctx->head->field->type->ndim, ndim);
30198  return -1;
30199  }
30200  for (i = 0; i < ctx->head->field->type->ndim; i++) {
30201  arraysize *= ctx->head->field->type->arraysize[i];
30202  }
30203  ctx->is_valid_array = 0;
30204  ctx->enc_count = 1;
30205  }
30206  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
30207  do {
30208  __Pyx_StructField* field = ctx->head->field;
30209  __Pyx_TypeInfo* type = field->type;
30210  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
30211  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
30212  } else {
30213  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
30214  }
30215  if (ctx->enc_packmode == '@') {
30216  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
30217  size_t align_mod_offset;
30218  if (align_at == 0) return -1;
30219  align_mod_offset = ctx->fmt_offset % align_at;
30220  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
30221  if (ctx->struct_alignment == 0)
30222  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
30223  ctx->is_complex);
30224  }
30225  if (type->size != size || type->typegroup != group) {
30226  if (type->typegroup == 'C' && type->fields != NULL) {
30227  size_t parent_offset = ctx->head->parent_offset + field->offset;
30228  ++ctx->head;
30229  ctx->head->field = type->fields;
30230  ctx->head->parent_offset = parent_offset;
30231  continue;
30232  }
30233  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
30234  } else {
30235  __Pyx_BufFmt_RaiseExpected(ctx);
30236  return -1;
30237  }
30238  }
30239  offset = ctx->head->parent_offset + field->offset;
30240  if (ctx->fmt_offset != offset) {
30241  PyErr_Format(PyExc_ValueError,
30242  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
30243  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
30244  return -1;
30245  }
30246  ctx->fmt_offset += size;
30247  if (arraysize)
30248  ctx->fmt_offset += (arraysize - 1) * size;
30249  --ctx->enc_count;
30250  while (1) {
30251  if (field == &ctx->root) {
30252  ctx->head = NULL;
30253  if (ctx->enc_count != 0) {
30254  __Pyx_BufFmt_RaiseExpected(ctx);
30255  return -1;
30256  }
30257  break;
30258  }
30259  ctx->head->field = ++field;
30260  if (field->type == NULL) {
30261  --ctx->head;
30262  field = ctx->head->field;
30263  continue;
30264  } else if (field->type->typegroup == 'S') {
30265  size_t parent_offset = ctx->head->parent_offset + field->offset;
30266  if (field->type->fields->type == NULL) continue;
30267  field = field->type->fields;
30268  ++ctx->head;
30269  ctx->head->field = field;
30270  ctx->head->parent_offset = parent_offset;
30271  break;
30272  } else {
30273  break;
30274  }
30275  }
30276  } while (ctx->enc_count);
30277  ctx->enc_type = 0;
30278  ctx->is_complex = 0;
30279  return 0;
30280 }
30281 static PyObject *
30282 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
30283 {
30284  const char *ts = *tsp;
30285  int i = 0, number, ndim;
30286  ++ts;
30287  if (ctx->new_count != 1) {
30288  PyErr_SetString(PyExc_ValueError,
30289  "Cannot handle repeated arrays in format string");
30290  return NULL;
30291  }
30292  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30293  ndim = ctx->head->field->type->ndim;
30294  while (*ts && *ts != ')') {
30295  switch (*ts) {
30296  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
30297  default: break;
30298  }
30299  number = __Pyx_BufFmt_ExpectNumber(&ts);
30300  if (number == -1) return NULL;
30301  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
30302  return PyErr_Format(PyExc_ValueError,
30303  "Expected a dimension of size %zu, got %d",
30304  ctx->head->field->type->arraysize[i], number);
30305  if (*ts != ',' && *ts != ')')
30306  return PyErr_Format(PyExc_ValueError,
30307  "Expected a comma in format string, got '%c'", *ts);
30308  if (*ts == ',') ts++;
30309  i++;
30310  }
30311  if (i != ndim)
30312  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
30313  ctx->head->field->type->ndim, i);
30314  if (!*ts) {
30315  PyErr_SetString(PyExc_ValueError,
30316  "Unexpected end of format string, expected ')'");
30317  return NULL;
30318  }
30319  ctx->is_valid_array = 1;
30320  ctx->new_count = 1;
30321  *tsp = ++ts;
30322  return Py_None;
30323 }
30324 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
30325  int got_Z = 0;
30326  while (1) {
30327  switch(*ts) {
30328  case 0:
30329  if (ctx->enc_type != 0 && ctx->head == NULL) {
30330  __Pyx_BufFmt_RaiseExpected(ctx);
30331  return NULL;
30332  }
30333  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30334  if (ctx->head != NULL) {
30335  __Pyx_BufFmt_RaiseExpected(ctx);
30336  return NULL;
30337  }
30338  return ts;
30339  case ' ':
30340  case '\r':
30341  case '\n':
30342  ++ts;
30343  break;
30344  case '<':
30345  if (!__Pyx_Is_Little_Endian()) {
30346  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
30347  return NULL;
30348  }
30349  ctx->new_packmode = '=';
30350  ++ts;
30351  break;
30352  case '>':
30353  case '!':
30354  if (__Pyx_Is_Little_Endian()) {
30355  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
30356  return NULL;
30357  }
30358  ctx->new_packmode = '=';
30359  ++ts;
30360  break;
30361  case '=':
30362  case '@':
30363  case '^':
30364  ctx->new_packmode = *ts++;
30365  break;
30366  case 'T':
30367  {
30368  const char* ts_after_sub;
30369  size_t i, struct_count = ctx->new_count;
30370  size_t struct_alignment = ctx->struct_alignment;
30371  ctx->new_count = 1;
30372  ++ts;
30373  if (*ts != '{') {
30374  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
30375  return NULL;
30376  }
30377  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30378  ctx->enc_type = 0;
30379  ctx->enc_count = 0;
30380  ctx->struct_alignment = 0;
30381  ++ts;
30382  ts_after_sub = ts;
30383  for (i = 0; i != struct_count; ++i) {
30384  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
30385  if (!ts_after_sub) return NULL;
30386  }
30387  ts = ts_after_sub;
30388  if (struct_alignment) ctx->struct_alignment = struct_alignment;
30389  }
30390  break;
30391  case '}':
30392  {
30393  size_t alignment = ctx->struct_alignment;
30394  ++ts;
30395  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30396  ctx->enc_type = 0;
30397  if (alignment && ctx->fmt_offset % alignment) {
30398  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
30399  }
30400  }
30401  return ts;
30402  case 'x':
30403  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30404  ctx->fmt_offset += ctx->new_count;
30405  ctx->new_count = 1;
30406  ctx->enc_count = 0;
30407  ctx->enc_type = 0;
30408  ctx->enc_packmode = ctx->new_packmode;
30409  ++ts;
30410  break;
30411  case 'Z':
30412  got_Z = 1;
30413  ++ts;
30414  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
30415  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
30416  return NULL;
30417  }
30418  CYTHON_FALLTHROUGH;
30419  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
30420  case 'l': case 'L': case 'q': case 'Q':
30421  case 'f': case 'd': case 'g':
30422  case 'O': case 'p':
30423  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
30424  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
30425  ctx->enc_count += ctx->new_count;
30426  ctx->new_count = 1;
30427  got_Z = 0;
30428  ++ts;
30429  break;
30430  }
30431  CYTHON_FALLTHROUGH;
30432  case 's':
30433  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
30434  ctx->enc_count = ctx->new_count;
30435  ctx->enc_packmode = ctx->new_packmode;
30436  ctx->enc_type = *ts;
30437  ctx->is_complex = got_Z;
30438  ++ts;
30439  ctx->new_count = 1;
30440  got_Z = 0;
30441  break;
30442  case ':':
30443  ++ts;
30444  while(*ts != ':') ++ts;
30445  ++ts;
30446  break;
30447  case '(':
30448  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
30449  break;
30450  default:
30451  {
30452  int number = __Pyx_BufFmt_ExpectNumber(&ts);
30453  if (number == -1) return NULL;
30454  ctx->new_count = (size_t)number;
30455  }
30456  }
30457  }
30458 }
30459 
30460 /* TypeInfoCompare */
30461  static int
30462 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
30463 {
30464  int i;
30465  if (!a || !b)
30466  return 0;
30467  if (a == b)
30468  return 1;
30469  if (a->size != b->size || a->typegroup != b->typegroup ||
30470  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
30471  if (a->typegroup == 'H' || b->typegroup == 'H') {
30472  return a->size == b->size;
30473  } else {
30474  return 0;
30475  }
30476  }
30477  if (a->ndim) {
30478  for (i = 0; i < a->ndim; i++)
30479  if (a->arraysize[i] != b->arraysize[i])
30480  return 0;
30481  }
30482  if (a->typegroup == 'S') {
30483  if (a->flags != b->flags)
30484  return 0;
30485  if (a->fields || b->fields) {
30486  if (!(a->fields && b->fields))
30487  return 0;
30488  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
30489  __Pyx_StructField *field_a = a->fields + i;
30490  __Pyx_StructField *field_b = b->fields + i;
30491  if (field_a->offset != field_b->offset ||
30492  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
30493  return 0;
30494  }
30495  return !a->fields[i].type && !b->fields[i].type;
30496  }
30497  }
30498  return 1;
30499 }
30500 
30501 /* MemviewSliceValidateAndInit */
30502  static int
30503 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
30504 {
30505  if (buf->shape[dim] <= 1)
30506  return 1;
30507  if (buf->strides) {
30508  if (spec & __Pyx_MEMVIEW_CONTIG) {
30509  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
30510  if (unlikely(buf->strides[dim] != sizeof(void *))) {
30511  PyErr_Format(PyExc_ValueError,
30512  "Buffer is not indirectly contiguous "
30513  "in dimension %d.", dim);
30514  goto fail;
30515  }
30516  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
30517  PyErr_SetString(PyExc_ValueError,
30518  "Buffer and memoryview are not contiguous "
30519  "in the same dimension.");
30520  goto fail;
30521  }
30522  }
30523  if (spec & __Pyx_MEMVIEW_FOLLOW) {
30524  Py_ssize_t stride = buf->strides[dim];
30525  if (stride < 0)
30526  stride = -stride;
30527  if (unlikely(stride < buf->itemsize)) {
30528  PyErr_SetString(PyExc_ValueError,
30529  "Buffer and memoryview are not contiguous "
30530  "in the same dimension.");
30531  goto fail;
30532  }
30533  }
30534  } else {
30535  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
30536  PyErr_Format(PyExc_ValueError,
30537  "C-contiguous buffer is not contiguous in "
30538  "dimension %d", dim);
30539  goto fail;
30540  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
30541  PyErr_Format(PyExc_ValueError,
30542  "C-contiguous buffer is not indirect in "
30543  "dimension %d", dim);
30544  goto fail;
30545  } else if (unlikely(buf->suboffsets)) {
30546  PyErr_SetString(PyExc_ValueError,
30547  "Buffer exposes suboffsets but no strides");
30548  goto fail;
30549  }
30550  }
30551  return 1;
30552 fail:
30553  return 0;
30554 }
30555 static int
30556 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
30557 {
30558  if (spec & __Pyx_MEMVIEW_DIRECT) {
30559  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
30560  PyErr_Format(PyExc_ValueError,
30561  "Buffer not compatible with direct access "
30562  "in dimension %d.", dim);
30563  goto fail;
30564  }
30565  }
30566  if (spec & __Pyx_MEMVIEW_PTR) {
30567  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
30568  PyErr_Format(PyExc_ValueError,
30569  "Buffer is not indirectly accessible "
30570  "in dimension %d.", dim);
30571  goto fail;
30572  }
30573  }
30574  return 1;
30575 fail:
30576  return 0;
30577 }
30578 static int
30579 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
30580 {
30581  int i;
30582  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
30583  Py_ssize_t stride = 1;
30584  for (i = 0; i < ndim; i++) {
30585  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
30586  PyErr_SetString(PyExc_ValueError,
30587  "Buffer not fortran contiguous.");
30588  goto fail;
30589  }
30590  stride = stride * buf->shape[i];
30591  }
30592  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
30593  Py_ssize_t stride = 1;
30594  for (i = ndim - 1; i >- 1; i--) {
30595  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
30596  PyErr_SetString(PyExc_ValueError,
30597  "Buffer not C contiguous.");
30598  goto fail;
30599  }
30600  stride = stride * buf->shape[i];
30601  }
30602  }
30603  return 1;
30604 fail:
30605  return 0;
30606 }
30607 static int __Pyx_ValidateAndInit_memviewslice(
30608  int *axes_specs,
30609  int c_or_f_flag,
30610  int buf_flags,
30611  int ndim,
30612  __Pyx_TypeInfo *dtype,
30613  __Pyx_BufFmt_StackElem stack[],
30614  __Pyx_memviewslice *memviewslice,
30615  PyObject *original_obj)
30616 {
30617  struct __pyx_memoryview_obj *memview, *new_memview;
30618  __Pyx_RefNannyDeclarations
30619  Py_buffer *buf;
30620  int i, spec = 0, retval = -1;
30621  __Pyx_BufFmt_Context ctx;
30622  int from_memoryview = __pyx_memoryview_check(original_obj);
30623  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
30624  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
30625  original_obj)->typeinfo)) {
30626  memview = (struct __pyx_memoryview_obj *) original_obj;
30627  new_memview = NULL;
30628  } else {
30629  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
30630  original_obj, buf_flags, 0, dtype);
30631  new_memview = memview;
30632  if (unlikely(!memview))
30633  goto fail;
30634  }
30635  buf = &memview->view;
30636  if (unlikely(buf->ndim != ndim)) {
30637  PyErr_Format(PyExc_ValueError,
30638  "Buffer has wrong number of dimensions (expected %d, got %d)",
30639  ndim, buf->ndim);
30640  goto fail;
30641  }
30642  if (new_memview) {
30643  __Pyx_BufFmt_Init(&ctx, stack, dtype);
30644  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
30645  }
30646  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
30647  PyErr_Format(PyExc_ValueError,
30648  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
30649  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
30650  buf->itemsize,
30651  (buf->itemsize > 1) ? "s" : "",
30652  dtype->name,
30653  dtype->size,
30654  (dtype->size > 1) ? "s" : "");
30655  goto fail;
30656  }
30657  if (buf->len > 0) {
30658  for (i = 0; i < ndim; i++) {
30659  spec = axes_specs[i];
30660  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
30661  goto fail;
30662  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
30663  goto fail;
30664  }
30665  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
30666  goto fail;
30667  }
30668  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
30669  new_memview != NULL) == -1)) {
30670  goto fail;
30671  }
30672  retval = 0;
30673  goto no_fail;
30674 fail:
30675  Py_XDECREF(new_memview);
30676  retval = -1;
30677 no_fail:
30678  __Pyx_RefNannyFinishContext();
30679  return retval;
30680 }
30681 
30682 /* ObjectToMemviewSlice */
30683  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj, int writable_flag) {
30684  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30685  __Pyx_BufFmt_StackElem stack[1];
30686  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
30687  int retcode;
30688  if (obj == Py_None) {
30689  result.memview = (struct __pyx_memoryview_obj *) Py_None;
30690  return result;
30691  }
30692  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
30693  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
30694  &__Pyx_TypeInfo_float, stack,
30695  &result, obj);
30696  if (unlikely(retcode == -1))
30697  goto __pyx_fail;
30698  return result;
30699 __pyx_fail:
30700  result.memview = NULL;
30701  result.data = NULL;
30702  return result;
30703 }
30704 
30705 /* CIntFromPyVerify */
30706  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
30707  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
30708 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
30709  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
30710 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
30711  {\
30712  func_type value = func_value;\
30713  if (sizeof(target_type) < sizeof(func_type)) {\
30714  if (unlikely(value != (func_type) (target_type) value)) {\
30715  func_type zero = 0;\
30716  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
30717  return (target_type) -1;\
30718  if (is_unsigned && unlikely(value < zero))\
30719  goto raise_neg_overflow;\
30720  else\
30721  goto raise_overflow;\
30722  }\
30723  }\
30724  return (target_type) value;\
30725  }
30726 
30727 /* ObjectToMemviewSlice */
30728  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) {
30729  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30730  __Pyx_BufFmt_StackElem stack[1];
30731  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
30732  int retcode;
30733  if (obj == Py_None) {
30734  result.memview = (struct __pyx_memoryview_obj *) Py_None;
30735  return result;
30736  }
30737  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
30738  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
30739  &__Pyx_TypeInfo_double, stack,
30740  &result, obj);
30741  if (unlikely(retcode == -1))
30742  goto __pyx_fail;
30743  return result;
30744 __pyx_fail:
30745  result.memview = NULL;
30746  result.data = NULL;
30747  return result;
30748 }
30749 
30750 /* ObjectToMemviewSlice */
30751  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
30752  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30753  __Pyx_BufFmt_StackElem stack[1];
30754  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
30755  int retcode;
30756  if (obj == Py_None) {
30757  result.memview = (struct __pyx_memoryview_obj *) Py_None;
30758  return result;
30759  }
30760  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
30761  PyBUF_RECORDS_RO | writable_flag, 1,
30762  &__Pyx_TypeInfo_float, stack,
30763  &result, obj);
30764  if (unlikely(retcode == -1))
30765  goto __pyx_fail;
30766  return result;
30767 __pyx_fail:
30768  result.memview = NULL;
30769  result.data = NULL;
30770  return result;
30771 }
30772 
30773 /* ObjectToMemviewSlice */
30774  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
30775  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
30776  __Pyx_BufFmt_StackElem stack[1];
30777  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
30778  int retcode;
30779  if (obj == Py_None) {
30780  result.memview = (struct __pyx_memoryview_obj *) Py_None;
30781  return result;
30782  }
30783  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
30784  PyBUF_RECORDS_RO | writable_flag, 1,
30785  &__Pyx_TypeInfo_double, stack,
30786  &result, obj);
30787  if (unlikely(retcode == -1))
30788  goto __pyx_fail;
30789  return result;
30790 __pyx_fail:
30791  result.memview = NULL;
30792  result.data = NULL;
30793  return result;
30794 }
30795 
30796 /* MemviewSliceCopyTemplate */
30797  static __Pyx_memviewslice
30798 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
30799  const char *mode, int ndim,
30800  size_t sizeof_dtype, int contig_flag,
30801  int dtype_is_object)
30802 {
30803  __Pyx_RefNannyDeclarations
30804  int i;
30805  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
30806  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
30807  Py_buffer *buf = &from_memview->view;
30808  PyObject *shape_tuple = NULL;
30809  PyObject *temp_int = NULL;
30810  struct __pyx_array_obj *array_obj = NULL;
30811  struct __pyx_memoryview_obj *memview_obj = NULL;
30812  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
30813  for (i = 0; i < ndim; i++) {
30814  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
30815  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
30816  "indirect dimensions (axis %d)", i);
30817  goto fail;
30818  }
30819  }
30820  shape_tuple = PyTuple_New(ndim);
30821  if (unlikely(!shape_tuple)) {
30822  goto fail;
30823  }
30824  __Pyx_GOTREF(shape_tuple);
30825  for(i = 0; i < ndim; i++) {
30826  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
30827  if(unlikely(!temp_int)) {
30828  goto fail;
30829  } else {
30830  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
30831  temp_int = NULL;
30832  }
30833  }
30834  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
30835  if (unlikely(!array_obj)) {
30836  goto fail;
30837  }
30838  __Pyx_GOTREF(array_obj);
30839  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
30840  (PyObject *) array_obj, contig_flag,
30841  dtype_is_object,
30842  from_mvs->memview->typeinfo);
30843  if (unlikely(!memview_obj))
30844  goto fail;
30845  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
30846  goto fail;
30847  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
30848  dtype_is_object) < 0))
30849  goto fail;
30850  goto no_fail;
30851 fail:
30852  __Pyx_XDECREF(new_mvs.memview);
30853  new_mvs.memview = NULL;
30854  new_mvs.data = NULL;
30855 no_fail:
30856  __Pyx_XDECREF(shape_tuple);
30857  __Pyx_XDECREF(temp_int);
30858  __Pyx_XDECREF(array_obj);
30859  __Pyx_RefNannyFinishContext();
30860  return new_mvs;
30861 }
30862 
30863 /* CIntToPy */
30864  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
30865 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30866 #pragma GCC diagnostic push
30867 #pragma GCC diagnostic ignored "-Wconversion"
30868 #endif
30869  const long neg_one = (long) -1, const_zero = (long) 0;
30870 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30871 #pragma GCC diagnostic pop
30872 #endif
30873  const int is_unsigned = neg_one > const_zero;
30874  if (is_unsigned) {
30875  if (sizeof(long) < sizeof(long)) {
30876  return PyInt_FromLong((long) value);
30877  } else if (sizeof(long) <= sizeof(unsigned long)) {
30878  return PyLong_FromUnsignedLong((unsigned long) value);
30879 #ifdef HAVE_LONG_LONG
30880  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
30881  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
30882 #endif
30883  }
30884  } else {
30885  if (sizeof(long) <= sizeof(long)) {
30886  return PyInt_FromLong((long) value);
30887 #ifdef HAVE_LONG_LONG
30888  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
30889  return PyLong_FromLongLong((PY_LONG_LONG) value);
30890 #endif
30891  }
30892  }
30893  {
30894  int one = 1; int little = (int)*(unsigned char *)&one;
30895  unsigned char *bytes = (unsigned char *)&value;
30896  return _PyLong_FromByteArray(bytes, sizeof(long),
30897  little, !is_unsigned);
30898  }
30899 }
30900 
30901 /* CIntFromPy */
30902  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
30903 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30904 #pragma GCC diagnostic push
30905 #pragma GCC diagnostic ignored "-Wconversion"
30906 #endif
30907  const int neg_one = (int) -1, const_zero = (int) 0;
30908 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30909 #pragma GCC diagnostic pop
30910 #endif
30911  const int is_unsigned = neg_one > const_zero;
30912 #if PY_MAJOR_VERSION < 3
30913  if (likely(PyInt_Check(x))) {
30914  if (sizeof(int) < sizeof(long)) {
30915  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
30916  } else {
30917  long val = PyInt_AS_LONG(x);
30918  if (is_unsigned && unlikely(val < 0)) {
30919  goto raise_neg_overflow;
30920  }
30921  return (int) val;
30922  }
30923  } else
30924 #endif
30925  if (likely(PyLong_Check(x))) {
30926  if (is_unsigned) {
30927 #if CYTHON_USE_PYLONG_INTERNALS
30928  const digit* digits = ((PyLongObject*)x)->ob_digit;
30929  switch (Py_SIZE(x)) {
30930  case 0: return (int) 0;
30931  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
30932  case 2:
30933  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
30934  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30935  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30936  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
30937  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
30938  }
30939  }
30940  break;
30941  case 3:
30942  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
30943  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
30944  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30945  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
30946  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
30947  }
30948  }
30949  break;
30950  case 4:
30951  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
30952  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
30953  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30954  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
30955  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
30956  }
30957  }
30958  break;
30959  }
30960 #endif
30961 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
30962  if (unlikely(Py_SIZE(x) < 0)) {
30963  goto raise_neg_overflow;
30964  }
30965 #else
30966  {
30967  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
30968  if (unlikely(result < 0))
30969  return (int) -1;
30970  if (unlikely(result == 1))
30971  goto raise_neg_overflow;
30972  }
30973 #endif
30974  if (sizeof(int) <= sizeof(unsigned long)) {
30975  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
30976 #ifdef HAVE_LONG_LONG
30977  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
30978  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
30979 #endif
30980  }
30981  } else {
30982 #if CYTHON_USE_PYLONG_INTERNALS
30983  const digit* digits = ((PyLongObject*)x)->ob_digit;
30984  switch (Py_SIZE(x)) {
30985  case 0: return (int) 0;
30986  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
30987  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
30988  case -2:
30989  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
30990  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
30991  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
30992  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
30993  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
30994  }
30995  }
30996  break;
30997  case 2:
30998  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
30999  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31000  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31001  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
31002  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31003  }
31004  }
31005  break;
31006  case -3:
31007  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
31008  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31009  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31010  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
31011  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31012  }
31013  }
31014  break;
31015  case 3:
31016  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
31017  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31018  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31019  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
31020  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31021  }
31022  }
31023  break;
31024  case -4:
31025  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
31026  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31027  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31028  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
31029  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31030  }
31031  }
31032  break;
31033  case 4:
31034  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
31035  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31036  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31037  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
31038  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
31039  }
31040  }
31041  break;
31042  }
31043 #endif
31044  if (sizeof(int) <= sizeof(long)) {
31045  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
31046 #ifdef HAVE_LONG_LONG
31047  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
31048  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
31049 #endif
31050  }
31051  }
31052  {
31053 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31054  PyErr_SetString(PyExc_RuntimeError,
31055  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31056 #else
31057  int val;
31058  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31059  #if PY_MAJOR_VERSION < 3
31060  if (likely(v) && !PyLong_Check(v)) {
31061  PyObject *tmp = v;
31062  v = PyNumber_Long(tmp);
31063  Py_DECREF(tmp);
31064  }
31065  #endif
31066  if (likely(v)) {
31067  int one = 1; int is_little = (int)*(unsigned char *)&one;
31068  unsigned char *bytes = (unsigned char *)&val;
31069  int ret = _PyLong_AsByteArray((PyLongObject *)v,
31070  bytes, sizeof(val),
31071  is_little, !is_unsigned);
31072  Py_DECREF(v);
31073  if (likely(!ret))
31074  return val;
31075  }
31076 #endif
31077  return (int) -1;
31078  }
31079  } else {
31080  int val;
31081  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31082  if (!tmp) return (int) -1;
31083  val = __Pyx_PyInt_As_int(tmp);
31084  Py_DECREF(tmp);
31085  return val;
31086  }
31087 raise_overflow:
31088  PyErr_SetString(PyExc_OverflowError,
31089  "value too large to convert to int");
31090  return (int) -1;
31091 raise_neg_overflow:
31092  PyErr_SetString(PyExc_OverflowError,
31093  "can't convert negative value to int");
31094  return (int) -1;
31095 }
31096 
31097 /* CIntToPy */
31098  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
31099 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31100 #pragma GCC diagnostic push
31101 #pragma GCC diagnostic ignored "-Wconversion"
31102 #endif
31103  const int neg_one = (int) -1, const_zero = (int) 0;
31104 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31105 #pragma GCC diagnostic pop
31106 #endif
31107  const int is_unsigned = neg_one > const_zero;
31108  if (is_unsigned) {
31109  if (sizeof(int) < sizeof(long)) {
31110  return PyInt_FromLong((long) value);
31111  } else if (sizeof(int) <= sizeof(unsigned long)) {
31112  return PyLong_FromUnsignedLong((unsigned long) value);
31113 #ifdef HAVE_LONG_LONG
31114  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
31115  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31116 #endif
31117  }
31118  } else {
31119  if (sizeof(int) <= sizeof(long)) {
31120  return PyInt_FromLong((long) value);
31121 #ifdef HAVE_LONG_LONG
31122  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
31123  return PyLong_FromLongLong((PY_LONG_LONG) value);
31124 #endif
31125  }
31126  }
31127  {
31128  int one = 1; int little = (int)*(unsigned char *)&one;
31129  unsigned char *bytes = (unsigned char *)&value;
31130  return _PyLong_FromByteArray(bytes, sizeof(int),
31131  little, !is_unsigned);
31132  }
31133 }
31134 
31135 /* CIntFromPy */
31136  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
31137 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31138 #pragma GCC diagnostic push
31139 #pragma GCC diagnostic ignored "-Wconversion"
31140 #endif
31141  const long neg_one = (long) -1, const_zero = (long) 0;
31142 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31143 #pragma GCC diagnostic pop
31144 #endif
31145  const int is_unsigned = neg_one > const_zero;
31146 #if PY_MAJOR_VERSION < 3
31147  if (likely(PyInt_Check(x))) {
31148  if (sizeof(long) < sizeof(long)) {
31149  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
31150  } else {
31151  long val = PyInt_AS_LONG(x);
31152  if (is_unsigned && unlikely(val < 0)) {
31153  goto raise_neg_overflow;
31154  }
31155  return (long) val;
31156  }
31157  } else
31158 #endif
31159  if (likely(PyLong_Check(x))) {
31160  if (is_unsigned) {
31161 #if CYTHON_USE_PYLONG_INTERNALS
31162  const digit* digits = ((PyLongObject*)x)->ob_digit;
31163  switch (Py_SIZE(x)) {
31164  case 0: return (long) 0;
31165  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
31166  case 2:
31167  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
31168  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31169  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31170  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
31171  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
31172  }
31173  }
31174  break;
31175  case 3:
31176  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
31177  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31178  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31179  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
31180  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
31181  }
31182  }
31183  break;
31184  case 4:
31185  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
31186  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31187  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31188  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
31189  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
31190  }
31191  }
31192  break;
31193  }
31194 #endif
31195 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
31196  if (unlikely(Py_SIZE(x) < 0)) {
31197  goto raise_neg_overflow;
31198  }
31199 #else
31200  {
31201  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
31202  if (unlikely(result < 0))
31203  return (long) -1;
31204  if (unlikely(result == 1))
31205  goto raise_neg_overflow;
31206  }
31207 #endif
31208  if (sizeof(long) <= sizeof(unsigned long)) {
31209  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
31210 #ifdef HAVE_LONG_LONG
31211  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
31212  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
31213 #endif
31214  }
31215  } else {
31216 #if CYTHON_USE_PYLONG_INTERNALS
31217  const digit* digits = ((PyLongObject*)x)->ob_digit;
31218  switch (Py_SIZE(x)) {
31219  case 0: return (long) 0;
31220  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
31221  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
31222  case -2:
31223  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
31224  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31225  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31226  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
31227  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31228  }
31229  }
31230  break;
31231  case 2:
31232  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
31233  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31234  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31235  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
31236  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31237  }
31238  }
31239  break;
31240  case -3:
31241  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
31242  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31243  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31244  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
31245  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31246  }
31247  }
31248  break;
31249  case 3:
31250  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
31251  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31252  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31253  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
31254  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31255  }
31256  }
31257  break;
31258  case -4:
31259  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
31260  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31261  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31262  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
31263  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31264  }
31265  }
31266  break;
31267  case 4:
31268  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
31269  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31270  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31271  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
31272  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
31273  }
31274  }
31275  break;
31276  }
31277 #endif
31278  if (sizeof(long) <= sizeof(long)) {
31279  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
31280 #ifdef HAVE_LONG_LONG
31281  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
31282  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
31283 #endif
31284  }
31285  }
31286  {
31287 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31288  PyErr_SetString(PyExc_RuntimeError,
31289  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31290 #else
31291  long val;
31292  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31293  #if PY_MAJOR_VERSION < 3
31294  if (likely(v) && !PyLong_Check(v)) {
31295  PyObject *tmp = v;
31296  v = PyNumber_Long(tmp);
31297  Py_DECREF(tmp);
31298  }
31299  #endif
31300  if (likely(v)) {
31301  int one = 1; int is_little = (int)*(unsigned char *)&one;
31302  unsigned char *bytes = (unsigned char *)&val;
31303  int ret = _PyLong_AsByteArray((PyLongObject *)v,
31304  bytes, sizeof(val),
31305  is_little, !is_unsigned);
31306  Py_DECREF(v);
31307  if (likely(!ret))
31308  return val;
31309  }
31310 #endif
31311  return (long) -1;
31312  }
31313  } else {
31314  long val;
31315  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31316  if (!tmp) return (long) -1;
31317  val = __Pyx_PyInt_As_long(tmp);
31318  Py_DECREF(tmp);
31319  return val;
31320  }
31321 raise_overflow:
31322  PyErr_SetString(PyExc_OverflowError,
31323  "value too large to convert to long");
31324  return (long) -1;
31325 raise_neg_overflow:
31326  PyErr_SetString(PyExc_OverflowError,
31327  "can't convert negative value to long");
31328  return (long) -1;
31329 }
31330 
31331 /* CIntFromPy */
31332  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
31333 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31334 #pragma GCC diagnostic push
31335 #pragma GCC diagnostic ignored "-Wconversion"
31336 #endif
31337  const char neg_one = (char) -1, const_zero = (char) 0;
31338 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31339 #pragma GCC diagnostic pop
31340 #endif
31341  const int is_unsigned = neg_one > const_zero;
31342 #if PY_MAJOR_VERSION < 3
31343  if (likely(PyInt_Check(x))) {
31344  if (sizeof(char) < sizeof(long)) {
31345  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
31346  } else {
31347  long val = PyInt_AS_LONG(x);
31348  if (is_unsigned && unlikely(val < 0)) {
31349  goto raise_neg_overflow;
31350  }
31351  return (char) val;
31352  }
31353  } else
31354 #endif
31355  if (likely(PyLong_Check(x))) {
31356  if (is_unsigned) {
31357 #if CYTHON_USE_PYLONG_INTERNALS
31358  const digit* digits = ((PyLongObject*)x)->ob_digit;
31359  switch (Py_SIZE(x)) {
31360  case 0: return (char) 0;
31361  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
31362  case 2:
31363  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
31364  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31365  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31366  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
31367  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
31368  }
31369  }
31370  break;
31371  case 3:
31372  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
31373  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31374  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31375  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
31376  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
31377  }
31378  }
31379  break;
31380  case 4:
31381  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
31382  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31383  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31384  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
31385  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
31386  }
31387  }
31388  break;
31389  }
31390 #endif
31391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
31392  if (unlikely(Py_SIZE(x) < 0)) {
31393  goto raise_neg_overflow;
31394  }
31395 #else
31396  {
31397  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
31398  if (unlikely(result < 0))
31399  return (char) -1;
31400  if (unlikely(result == 1))
31401  goto raise_neg_overflow;
31402  }
31403 #endif
31404  if (sizeof(char) <= sizeof(unsigned long)) {
31405  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
31406 #ifdef HAVE_LONG_LONG
31407  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
31408  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
31409 #endif
31410  }
31411  } else {
31412 #if CYTHON_USE_PYLONG_INTERNALS
31413  const digit* digits = ((PyLongObject*)x)->ob_digit;
31414  switch (Py_SIZE(x)) {
31415  case 0: return (char) 0;
31416  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
31417  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
31418  case -2:
31419  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
31420  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31421  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31422  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
31423  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31424  }
31425  }
31426  break;
31427  case 2:
31428  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
31429  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
31430  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31431  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
31432  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31433  }
31434  }
31435  break;
31436  case -3:
31437  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
31438  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31439  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31440  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
31441  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31442  }
31443  }
31444  break;
31445  case 3:
31446  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
31447  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
31448  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31449  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
31450  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31451  }
31452  }
31453  break;
31454  case -4:
31455  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
31456  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31457  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31458  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
31459  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31460  }
31461  }
31462  break;
31463  case 4:
31464  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
31465  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
31466  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
31467  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
31468  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
31469  }
31470  }
31471  break;
31472  }
31473 #endif
31474  if (sizeof(char) <= sizeof(long)) {
31475  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
31476 #ifdef HAVE_LONG_LONG
31477  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
31478  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
31479 #endif
31480  }
31481  }
31482  {
31483 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
31484  PyErr_SetString(PyExc_RuntimeError,
31485  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
31486 #else
31487  char val;
31488  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
31489  #if PY_MAJOR_VERSION < 3
31490  if (likely(v) && !PyLong_Check(v)) {
31491  PyObject *tmp = v;
31492  v = PyNumber_Long(tmp);
31493  Py_DECREF(tmp);
31494  }
31495  #endif
31496  if (likely(v)) {
31497  int one = 1; int is_little = (int)*(unsigned char *)&one;
31498  unsigned char *bytes = (unsigned char *)&val;
31499  int ret = _PyLong_AsByteArray((PyLongObject *)v,
31500  bytes, sizeof(val),
31501  is_little, !is_unsigned);
31502  Py_DECREF(v);
31503  if (likely(!ret))
31504  return val;
31505  }
31506 #endif
31507  return (char) -1;
31508  }
31509  } else {
31510  char val;
31511  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
31512  if (!tmp) return (char) -1;
31513  val = __Pyx_PyInt_As_char(tmp);
31514  Py_DECREF(tmp);
31515  return val;
31516  }
31517 raise_overflow:
31518  PyErr_SetString(PyExc_OverflowError,
31519  "value too large to convert to char");
31520  return (char) -1;
31521 raise_neg_overflow:
31522  PyErr_SetString(PyExc_OverflowError,
31523  "can't convert negative value to char");
31524  return (char) -1;
31525 }
31526 
31527 /* CheckBinaryVersion */
31528  static int __Pyx_check_binary_version(void) {
31529  char ctversion[5];
31530  int same=1, i, found_dot;
31531  const char* rt_from_call = Py_GetVersion();
31532  PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
31533  found_dot = 0;
31534  for (i = 0; i < 4; i++) {
31535  if (!ctversion[i]) {
31536  same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
31537  break;
31538  }
31539  if (rt_from_call[i] != ctversion[i]) {
31540  same = 0;
31541  break;
31542  }
31543  }
31544  if (!same) {
31545  char rtversion[5] = {'\0'};
31546  char message[200];
31547  for (i=0; i<4; ++i) {
31548  if (rt_from_call[i] == '.') {
31549  if (found_dot) break;
31550  found_dot = 1;
31551  } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
31552  break;
31553  }
31554  rtversion[i] = rt_from_call[i];
31555  }
31556  PyOS_snprintf(message, sizeof(message),
31557  "compiletime version %s of module '%.100s' "
31558  "does not match runtime version %s",
31559  ctversion, __Pyx_MODULE_NAME, rtversion);
31560  return PyErr_WarnEx(NULL, message, 1);
31561  }
31562  return 0;
31563 }
31564 
31565 /* FunctionImport */
31566  #ifndef __PYX_HAVE_RT_ImportFunction_0_29_36
31567 #define __PYX_HAVE_RT_ImportFunction_0_29_36
31568 static int __Pyx_ImportFunction_0_29_36(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
31569  PyObject *d = 0;
31570  PyObject *cobj = 0;
31571  union {
31572  void (*fp)(void);
31573  void *p;
31574  } tmp;
31575  d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
31576  if (!d)
31577  goto bad;
31578  cobj = PyDict_GetItemString(d, funcname);
31579  if (!cobj) {
31580  PyErr_Format(PyExc_ImportError,
31581  "%.200s does not export expected C function %.200s",
31582  PyModule_GetName(module), funcname);
31583  goto bad;
31584  }
31585 #if PY_VERSION_HEX >= 0x02070000
31586  if (!PyCapsule_IsValid(cobj, sig)) {
31587  PyErr_Format(PyExc_TypeError,
31588  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
31589  PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
31590  goto bad;
31591  }
31592  tmp.p = PyCapsule_GetPointer(cobj, sig);
31593 #else
31594  {const char *desc, *s1, *s2;
31595  desc = (const char *)PyCObject_GetDesc(cobj);
31596  if (!desc)
31597  goto bad;
31598  s1 = desc; s2 = sig;
31599  while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
31600  if (*s1 != *s2) {
31601  PyErr_Format(PyExc_TypeError,
31602  "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
31603  PyModule_GetName(module), funcname, sig, desc);
31604  goto bad;
31605  }
31606  tmp.p = PyCObject_AsVoidPtr(cobj);}
31607 #endif
31608  *f = tmp.fp;
31609  if (!(*f))
31610  goto bad;
31611  Py_DECREF(d);
31612  return 0;
31613 bad:
31614  Py_XDECREF(d);
31615  return -1;
31616 }
31617 #endif
31618 
31619 /* InitStrings */
31620  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
31621  while (t->p) {
31622  #if PY_MAJOR_VERSION < 3
31623  if (t->is_unicode) {
31624  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
31625  } else if (t->intern) {
31626  *t->p = PyString_InternFromString(t->s);
31627  } else {
31628  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
31629  }
31630  #else
31631  if (t->is_unicode | t->is_str) {
31632  if (t->intern) {
31633  *t->p = PyUnicode_InternFromString(t->s);
31634  } else if (t->encoding) {
31635  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
31636  } else {
31637  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
31638  }
31639  } else {
31640  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
31641  }
31642  #endif
31643  if (!*t->p)
31644  return -1;
31645  if (PyObject_Hash(*t->p) == -1)
31646  return -1;
31647  ++t;
31648  }
31649  return 0;
31650 }
31651 
31652 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
31653  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
31654 }
31655 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
31656  Py_ssize_t ignore;
31657  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
31658 }
31659 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
31660 #if !CYTHON_PEP393_ENABLED
31661 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31662  char* defenc_c;
31663  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
31664  if (!defenc) return NULL;
31665  defenc_c = PyBytes_AS_STRING(defenc);
31666 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31667  {
31668  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
31669  char* c;
31670  for (c = defenc_c; c < end; c++) {
31671  if ((unsigned char) (*c) >= 128) {
31672  PyUnicode_AsASCIIString(o);
31673  return NULL;
31674  }
31675  }
31676  }
31677 #endif
31678  *length = PyBytes_GET_SIZE(defenc);
31679  return defenc_c;
31680 }
31681 #else
31682 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31683  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
31684 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31685  if (likely(PyUnicode_IS_ASCII(o))) {
31686  *length = PyUnicode_GET_LENGTH(o);
31687  return PyUnicode_AsUTF8(o);
31688  } else {
31689  PyUnicode_AsASCIIString(o);
31690  return NULL;
31691  }
31692 #else
31693  return PyUnicode_AsUTF8AndSize(o, length);
31694 #endif
31695 }
31696 #endif
31697 #endif
31698 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31699 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
31700  if (
31701 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31702  __Pyx_sys_getdefaultencoding_not_ascii &&
31703 #endif
31704  PyUnicode_Check(o)) {
31705  return __Pyx_PyUnicode_AsStringAndSize(o, length);
31706  } else
31707 #endif
31708 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
31709  if (PyByteArray_Check(o)) {
31710  *length = PyByteArray_GET_SIZE(o);
31711  return PyByteArray_AS_STRING(o);
31712  } else
31713 #endif
31714  {
31715  char* result;
31716  int r = PyBytes_AsStringAndSize(o, &result, length);
31717  if (unlikely(r < 0)) {
31718  return NULL;
31719  } else {
31720  return result;
31721  }
31722  }
31723 }
31724 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
31725  int is_true = x == Py_True;
31726  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
31727  else return PyObject_IsTrue(x);
31728 }
31729 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
31730  int retval;
31731  if (unlikely(!x)) return -1;
31732  retval = __Pyx_PyObject_IsTrue(x);
31733  Py_DECREF(x);
31734  return retval;
31735 }
31736 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
31737 #if PY_MAJOR_VERSION >= 3
31738  if (PyLong_Check(result)) {
31739  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
31740  "__int__ returned non-int (type %.200s). "
31741  "The ability to return an instance of a strict subclass of int "
31742  "is deprecated, and may be removed in a future version of Python.",
31743  Py_TYPE(result)->tp_name)) {
31744  Py_DECREF(result);
31745  return NULL;
31746  }
31747  return result;
31748  }
31749 #endif
31750  PyErr_Format(PyExc_TypeError,
31751  "__%.4s__ returned non-%.4s (type %.200s)",
31752  type_name, type_name, Py_TYPE(result)->tp_name);
31753  Py_DECREF(result);
31754  return NULL;
31755 }
31756 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
31757 #if CYTHON_USE_TYPE_SLOTS
31758  PyNumberMethods *m;
31759 #endif
31760  const char *name = NULL;
31761  PyObject *res = NULL;
31762 #if PY_MAJOR_VERSION < 3
31763  if (likely(PyInt_Check(x) || PyLong_Check(x)))
31764 #else
31765  if (likely(PyLong_Check(x)))
31766 #endif
31767  return __Pyx_NewRef(x);
31768 #if CYTHON_USE_TYPE_SLOTS
31769  m = Py_TYPE(x)->tp_as_number;
31770  #if PY_MAJOR_VERSION < 3
31771  if (m && m->nb_int) {
31772  name = "int";
31773  res = m->nb_int(x);
31774  }
31775  else if (m && m->nb_long) {
31776  name = "long";
31777  res = m->nb_long(x);
31778  }
31779  #else
31780  if (likely(m && m->nb_int)) {
31781  name = "int";
31782  res = m->nb_int(x);
31783  }
31784  #endif
31785 #else
31786  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
31787  res = PyNumber_Int(x);
31788  }
31789 #endif
31790  if (likely(res)) {
31791 #if PY_MAJOR_VERSION < 3
31792  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
31793 #else
31794  if (unlikely(!PyLong_CheckExact(res))) {
31795 #endif
31796  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
31797  }
31798  }
31799  else if (!PyErr_Occurred()) {
31800  PyErr_SetString(PyExc_TypeError,
31801  "an integer is required");
31802  }
31803  return res;
31804 }
31805 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
31806  Py_ssize_t ival;
31807  PyObject *x;
31808 #if PY_MAJOR_VERSION < 3
31809  if (likely(PyInt_CheckExact(b))) {
31810  if (sizeof(Py_ssize_t) >= sizeof(long))
31811  return PyInt_AS_LONG(b);
31812  else
31813  return PyInt_AsSsize_t(b);
31814  }
31815 #endif
31816  if (likely(PyLong_CheckExact(b))) {
31817  #if CYTHON_USE_PYLONG_INTERNALS
31818  const digit* digits = ((PyLongObject*)b)->ob_digit;
31819  const Py_ssize_t size = Py_SIZE(b);
31820  if (likely(__Pyx_sst_abs(size) <= 1)) {
31821  ival = likely(size) ? digits[0] : 0;
31822  if (size == -1) ival = -ival;
31823  return ival;
31824  } else {
31825  switch (size) {
31826  case 2:
31827  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
31828  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31829  }
31830  break;
31831  case -2:
31832  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
31833  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31834  }
31835  break;
31836  case 3:
31837  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
31838  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31839  }
31840  break;
31841  case -3:
31842  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
31843  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31844  }
31845  break;
31846  case 4:
31847  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
31848  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31849  }
31850  break;
31851  case -4:
31852  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
31853  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
31854  }
31855  break;
31856  }
31857  }
31858  #endif
31859  return PyLong_AsSsize_t(b);
31860  }
31861  x = PyNumber_Index(b);
31862  if (!x) return -1;
31863  ival = PyInt_AsSsize_t(x);
31864  Py_DECREF(x);
31865  return ival;
31866 }
31867 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
31868  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
31869  return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
31870 #if PY_MAJOR_VERSION < 3
31871  } else if (likely(PyInt_CheckExact(o))) {
31872  return PyInt_AS_LONG(o);
31873 #endif
31874  } else {
31875  Py_ssize_t ival;
31876  PyObject *x;
31877  x = PyNumber_Index(o);
31878  if (!x) return -1;
31879  ival = PyInt_AsLong(x);
31880  Py_DECREF(x);
31881  return ival;
31882  }
31883 }
31884 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
31885  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
31886 }
31887 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
31888  return PyInt_FromSize_t(ival);
31889 }
31890 
31891 
31892 #endif /* Py_PYTHON_H */
static DataType inner_product(const DataType *vector1, const DataType *vector2, const LongIndexType vector_size)
Computes Euclidean inner product of two vectors.